If we call UnregisterExternalImage() at non-render-thread and decrease the RenderTextureHost's ref-count to zero, the RenderTextureHost will be released in non-render-thread.
That will cause some problems if we use some thread-specific functions in ~RenderTextureHost().
This patch uses a message loop in UnregisterExternalImage() to resolve this problem.
MozReview-Commit-ID: CDazxGkE1cK
The RenderTextureHost might calls some thread-specific functions(e.g. OpenGL calls) in ~RenderTextureHost(). Add a checking here to prevent this problem.
MozReview-Commit-ID: 62QlavmXOig
WR supports the planar-ycbcr image format. We turn to use the planar-ycbcr image to get rid of the software-ycbcr-to-rgb color format conversion(using libyuv) in gecko.
The BufferTextureHost will use 3 image keys for SurfaceFormat::YUV format.
The RenderBufferTextureHost will also use 3 DataSourceSurfaces to represent the 3 channel data in planar-ycbcr format.
MozReview-Commit-ID: 3mMreSzKnMv
If we set a transform in push_stacking_context, it changes the internal
WebRender behaviour to make that stacking context a reference frame, and
things inside it are positioned differently. This is true even if the
transform is an identity transform.
In most cases we are hitting this and sending an identity transform
through, when in fact we want to be sending a None value to WebRender so
that it doesn't create reference frames. This is a partial fix, a proper
fix will be done in bug 1345577 by separating the CSS transform from the
other transforms that FrameLayerBuilder invents.
MozReview-Commit-ID: ElSs3hFMD2D
In addition to updating webrender and webrender_traits, this patch:
- bumps the euclid dependency in webrender_bindings to match webrender
- updates the Cargo.lock files and re-vendors third-party rust packages
- updates the push_yuv_image callers due to an API change in WR cset a4b9e25.
This patch does the following renamings, which increase consistency.
- GeckoProfilerInitRAII -> AutoProfilerInit
- GeckoProfilerThread{Sleep,Wake}RAII -> AutoProfilerThread{Sleep,Wake}
- GeckoProfilerTracingRAII -> AutoProfilerTracing
- AutoProfilerRegister -> AutoProfilerRegisterThread
- ProfilerStackFrameRAII -> AutoProfilerLabel
- nsJSUtils::mProfilerRAII -> nsJSUtils::mAutoProfilerLabel
Plus a few other minor ones (e.g. local variables).
The patch also add MOZ_GUARD_OBJECT macros to all the profiler RAII classes
that lack them, and does some minor whitespace reformatting.
--HG--
extra : rebase_source : 47e298fdd6f6b4af70e3357ec0b7b0580c0d0f50
This updates PushStateToWR to actually produce the scrollbar thumb transforms
and append them into the provided transform array.
MozReview-Commit-ID: 14xlpRQXhhq
In addition to update webrender/ and webrender_traits/, this updates
the webrender_bindings dependency on euclid to euclid-0.14.4. It also
updates some webrender_bindings code for this dependency update, and
for the BlobImageRenderer API change in WR cset 36a9117.
MozReview-Commit-ID: JlmTHrFdfUM
--HG--
rename : third_party/rust/euclid/src/matrix2d.rs => third_party/rust/euclid-0.13.0/src/matrix2d.rs
rename : third_party/rust/euclid/src/matrix4d.rs => third_party/rust/euclid-0.13.0/src/matrix4d.rs
extra : rebase_source : fbe93df33f5614d61536f090a69fe1588d34a34c
Use wr_api_add_external_image() to replace all types of ext-image adding functions.
Add a new interface wr_dp_push_yuv_interleaved_image() to put a single channel yuv_interleaved image in WR display list.
MozReview-Commit-ID: 1kDerOGwUuE
In addition to updating gfx/webrender and gfx/webrender_traits, this patch:
- Updates the webrender_bindings Cargo.toml file for version bumps
- Updates the Cargo.lock files and revendors the third-party rust dependecies
- Updates the webrender bindings for a change in the display list construction
and finalization API in WR csets 425155a and 1eb84eb.
We now have to pass around a content size parameter to construct a display list,
and we get back a content size from finalizing the display list. Since we pass
the finalization results over IPC to WebRenderBridgeParent, we need to update
the IPDL as well to pass this around.
- Updates the webrender bindings for a change to scroll_node_with_id in WR cset
48a098f.
- Updates the webrender bindings for a change to push_text in WR cset 3287c15.
This is the WR equivalent (but stripped down to the basics) of the code
in AsyncCompositionManager that advances APZ animations and applies the
async transform to the layer's shadow transform. Currently this doesn't
do anything fancy with the extra scrolling clips, or moving scrollbars,
etc.
MozReview-Commit-ID: BwbNRNHAc6G
The clips in WR do double-duty - they can be either scrolling clips or
non-scrolling clips. From gecko's point of view we want to treat them
separately so this updates the WebRenderAPI wrapper to expose two
different APIs for the two types of clips.
MozReview-Commit-ID: 3SLWkAq7Uxd
Two bugs:
* We were failing to (re)initialize the length to 0, leading to segfaults on Rust processing "empty" lists.
* We were setting the pointer of empty Vec's to null, which is technically UB in Rust because Vec tells Rust its pointer is non-null (this is why Option<Vec<T>> has the same size as Vec<T>). align_of::<T> is what it uses to as a non-null junk pointer, which in this case is 1.
MozReview-Commit-ID: Gzy1NtKlSV7
This updates more code that was using RelativeToParent() to use the
stacking context helper's ToRelativeWr* functions instead. This get us
closer to breaking the assumption that the WR stacking context order maps
1:1 to the layer tree structure.
MozReview-Commit-ID: HQrbvCgPOW4
Update for blob image and yuv image interface changes.
The implementation of the blob image renderer is empty now. It will need to be
updated in another commit. This also adds wr_dp_push_yuv_*_image() functions in
WebRenderAPI.
There is no change for |./mach vendor rust|.
MozReview-Commit-ID: Kk2rPAmt3vF
The new parameter "channel index" is used to select the specific channel data from a multiple channel textureHost(e.g. yuv format textureHost).
MozReview-Commit-ID: Ey1cA25Z6WH
In addition to updating the Cargo.toml/Cargo.lock files and generated FFI header,
this patch also:
- Updates a couple of field names in the IPC serialization code as a result
of webrender cset 8ca10a8
- Removes z-index related goop, since it's no longer needed as of webrender
cset c872232
Apparently passing a nullptr to slice::from_raw_parts is unsafe. So we
wrap those calls into a helper function that returns an empty slice
instead.
MozReview-Commit-ID: EAp90FKb8cQ
In addition to regenerating the FFI header and re-vendoring third-party rust
dependencies, this includes the following changes to webrender_bindings code:
- removal of release callback function as a result of changes in 86d4255
- update callback functions for new parameter added in d733af2
- update calls to add_raw_font for API change in 21f2946
The new rustfmt.toml is based off servo/rustfmt.toml with some
tweaks to match the existing code in webrender_bindings
MozReview-Commit-ID: 7LbXC6qyjan
--HG--
extra : amend_source : 436e49dbd3d3fd72aab0f1791cf6e0d3fcc348b4
Types also implement Copy, Clone now to make this easier.
MozReview-Commit-ID: GEVsCEw2o6K
--HG--
extra : rebase_source : b42ddaab3b7ab0a31006e78aff45ddb6e4160845
extra : amend_source : 82a7e1d272b397c8ab1d0346fd5a708117b897a3
This also includes changes to webrender_bindings:
- push_scroll_layer was renamed to push_clip_node in eb4a04b
- Update call to push_text for API change in f040e81.
MozReview-Commit-ID: ILHylvSkco2
Note that in upstream WR the push_scroll_layer API has already been
renamed to push_clip_node, so conceptually the same API covers both
"scrolling clips" (aka scroll layers) and non-scrolling clips. So using
the same underlying API for two different WebRenderAPI.h functions makes
sense.
MozReview-Commit-ID: He7jBVqZuLn
This commit adds some directives to help cbindgen generate correct
structs and functions, removes some old FFI code that isn't needed
anymore, and regenerates webrender_ffi_generated.h
MozReview-Commit-ID: KZSEZEN671A
--HG--
extra : rebase_source : 23a07dd11037943156983d9facc039bb7af51c95
This is only temporary as ExternalImageId has been made repr(C) upstream.
MozReview-Commit-ID: 1On7fRbNI4o
--HG--
extra : rebase_source : 91cb93829de5ccf0a6f0a05ed0d2169268b6c18c
This helps cbindgen know to generate a opaque struct for WrRenderedEpochs.
MozReview-Commit-ID: 7moOEBjjbOO
--HG--
extra : rebase_source : 49b3887ae21f659ac353b861f3566cc2817103b0
This removes the call to push_scroll_layer in wr_push_stacking_context, so that
it's now possible to push a stacking context without necessarily pushing a
scroll layer. There is already a separate function to push a scroll layer so the
call sites can do that. This patch just changes all the call sites that were
pushing a stacking context to also push a scroll layer, so there should be no
functional change. Future patches can remove the spurious scroll layers.
MozReview-Commit-ID: FtCkc9JQd8l
This includes:
- updating calls to push_scroll_layer for API change in 7253e2f.
- updating calls to push_stacking_context for API change in be249f6.
- updating for changes to gradient APIs in 05c4293.
Right now we just cast from a float* on the C++ side to a LayoutTransform on
the Rust side, except the LayoutTransform isn't a repr(C) storage type, so
there's no guarantee that it will actually have the same layout. Adding an
explicit type and conversion code ensure that we are able to pass the matrix
across the boundary safely.
MozReview-Commit-ID: H3gK3g0K3xz
The WrExternalImageId is currently a struct wrapping a uint64_t on the C++ side,
which is unnecessary as we can just typedef it directly to a uint64_t. On the
Rust side it's a tuple of (u64).
Also the WrExternalImageIdType enum should be WrExternalImageType for consistency.
MozReview-Commit-ID: DgOf4xfY9h3
The binding generator just takes the Rust field names and uses that in the
generated C++ structs. So installing the autogenerated bindings is easier if
we make sure the names are the same ahead of time.
MozReview-Commit-ID: 6cuzmtI5Qqw
This patch:
- adds a type alias for ExternalImageId and updates uses.
- renames WrExternalImageStruct to drop the "Struct" suffix which is redundant
and not present in the corresponding C++ struct.
- updates the delete-font function to use aliases I added previously.
MozReview-Commit-ID: ILsFihkMlIw
On the C++ side the enum extends from uint32_t, like all the other enums across
the WR FFI boundary. So the Rust side they should be repr(u32).
MozReview-Commit-ID: JOf44I154ea
In addition to updating gfx/webrender and gfx/webrender_traits, as well as the
Cargo.toml/Cargo.lock files and third-party rust dependencies, this updates
webrender_bindings for the following API changes:
- Update call to update_image for change in 086f912ea86d053d95e5f4eec00cae0d82ee5dba
- Update request_blob_image for new parameter added in 086f912ea86d053d95e5f4eec00cae0d82ee5dba.
- set_root_display_list got renamed to set_display_list, so update call sites.
1) make RenderTextureHost into a abstract base class for all RenderXXXTextureHost.
2) create a base class RenderTextureHostOGL for all texture handle base texture.
3) create RenderBufferTextureHost for buffer texture at render thread.
4) create RenderMacIOSurfaceTextureHostOGL for MacIOSurface at render thread.
--HG--
rename : gfx/webrender_bindings/RenderBufferTextureHost.h => gfx/webrender_bindings/RenderTextureHost.h
We will have a class RenderTextureHost as the base-class and its sub-class RenderBufferTextureHost in next patch. Use "rename" to preserve the file history.
MozReview-Commit-ID: KiqaO616AHc
--HG--
rename : gfx/webrender_bindings/RenderTextureHost.cpp => gfx/webrender_bindings/RenderBufferTextureHost.cpp
rename : gfx/webrender_bindings/RenderTextureHost.h => gfx/webrender_bindings/RenderBufferTextureHost.h
In addition to updating gfx/webrender and gfx/webrender_traits, this updates
gfx/webrender_bindings for:
- API changes to update_image and push_stacking_context.
- Version bumps needed in Cargo.toml
Also, since offscreen_gl_context is no longer a dependency, this patch removes
that crate and various other crates it depends on.
When changing the webrender profiler enabled/disabled state, the change propagates
to webrender via the main thread. This violates a thread assertion. However,
the thread assertion is mostly for documentation, so we can loosen it a little
to allow for this scenario.
MozReview-Commit-ID: FWfAchQUEUq
This is a largely uninteresting patch that just uses the DisplayListBuilder
directly. A wonderful cleanup patch will come after this. One of the more
interesting pieces is the use of PushBuiltDisplayList. This is needed for
handling empty transactions. See https://github.com/servo/webrender/pull/934
for more info.
This also updates webrender_bindings for a few API changes:
- new offset field in ImageDescriptor
- new tiling argument to add_image
- change in set_root_display_list
MozReview-Commit-ID: JUgPviRdekc