This is preparation for Bug 1868927.
By deferring ApplyAsyncImageForPipeline() for TextureHost in AsyncImagePipeline of synchronous WebRenderImageHost, ApplyAsyncImageForPipeline() can be called after the RemoteTextureHostWrapper is in the ready state.
Differential Revision: https://phabricator.services.mozilla.com/D197320
This is preparation for Bug 1868927.
By deferring ApplyAsyncImageForPipeline() for TextureHost in AsyncImagePipeline of synchronous WebRenderImageHost, ApplyAsyncImageForPipeline() can be called after the RemoteTextureHostWrapper is in the ready state.
Differential Revision: https://phabricator.services.mozilla.com/D197320
The APZ minimap is a debugging tool for Firefox developers, which can
be enabled with the pref apz.minimap.enabled.
When enabled, it shows a minimap overlay for every scroll frame, with
rects indicating the layout and visual viewports and the displayport.
We previously had an implementation for Layers that was removed when
Layers was removed. This patch is restoring an equivalent feature,
implemented for WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D190720
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().
The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.
HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.
Differential Revision: https://phabricator.services.mozilla.com/D192173
When root API is not used, the transaction could be delayed at WebRenderAPI::SendTransaction(). When sending transaction related to ImageBridge, we do not want the delay.
Differential Revision: https://phabricator.services.mozilla.com/D195751
Previously, this was hard coded to off for android, on for everything
else. With this change, it's controlled by a preference which
defaults to off for android, and on for everything else. This allows
users to disable subpixel AA on desktop for performance reasons.
Differential Revision: https://phabricator.services.mozilla.com/D180009
WebRenderAPI::FlushPendingWrTransactionEventsWithoutWait() does not wait remote texture ready. It should be OK, since it is called only in WebRenderBridgeParent::ClearResources(). But there were cases that hit the assert. The assert failure was false alarm.
The change suppresses assert of remote texture ready check in RemoteTextureMap::GetExternalImageIdOfRemoteTexture() if wait of the remote texture ready was skipped by the FlushPendingWrTransactionEventsWithoutWait().
Differential Revision: https://phabricator.services.mozilla.com/D176498
In current m-c, async RemoteTexture wait at RenderThread stops window update when the wait is too long. If async RemoteTexture is handled by WebRenderAPI, window could be updated during long async RemoteTexture wait.
async RemoteTexture wait of root WebRenderBridgeParent are disabled to simplify WebRenderAPI's wait handling.
offscreen canvas case is handled by WebRenderImageHost by Bug 1827578.
Differential Revision: https://phabricator.services.mozilla.com/D175590
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.
Non-virtual actors can still use `nsString` if they need to on the
receiving end.
Differential Revision: https://phabricator.services.mozilla.com/D152519
Also make the parent in ClipTemplate an Option, so that the
semantics are a bit clearer (follow up patches will remove this
parent field entirely).
Differential Revision: https://phabricator.services.mozilla.com/D150980
## Summary
Pass the fixed position element animation id through webrender, returning the
the animation id in the hit-test result if the element is a fixed position
element. This animation id then can be used to lookup the relevant Hit-Testing
Tree Node, which can be used to find the fixed (or sticky) position side bits.
## Motivation
Sticky content can be currently stuck to the root content or not, based on the
scroll position. As a result, when hit testing sticky content, APZ needs both
the sticky position side bits and additional information to determine if the
element is currently stuck to the root content. This is needed to fix the
hit-testing of sticky position content when a APZ transform is being applied,
such as overscroll and hiding the dynamic toolbar.
## Implementation
The information needed to determine if a element is currently stuck to the root
content and the fixed/sticky position side bits is already stored in the
hit-testing tree node. Any hit test result should have a corresponding
hit-testing tree node entry. When a hit-test result contains a animation id and
a hit-testing tree node is found, we can store a pointer to this node and use
this to check the fixed/sticky position side bits. Something similar is already
done for hit test results when a scrollbar is hit.
Differential Revision: https://phabricator.services.mozilla.com/D148648
Removes the last usage of the old-style clip-id parenting in
gecko. These paths passed the clip parent, but shouldn't be
necessary (all tests pass without them). Landing as a small
patch that's easy to bisect and back out if it does cause any
regression.
Differential Revision: https://phabricator.services.mozilla.com/D150050
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.
Differential Revision: https://phabricator.services.mozilla.com/D146145
P010 is trivially the same as NV12, but the 10-bit colors are packed into
the most significant bits instead of the least significant bits. This changes
the yuv shader to use the correct packing for P010. It treats P010 as its
own yuv format, which requires a lot of scaffolding.
Differential Revision: https://phabricator.services.mozilla.com/D140422
We need them for SVG primitives.
This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.
Differential Revision: https://phabricator.services.mozilla.com/D139024
This change mitigates the gap between the external_scroll_offset informed from
the main-thread and scroll_offset informed from APZ.
Some wrench reftests for this change are in the next commit.
Differential Revision: https://phabricator.services.mozilla.com/D133444
This includes some other changes;
1) Rename relevant functions
scroll_node_with_id -> set_scroll_offset
scroll_node -> set_scroll_offset
set_scroll_origin -> set_scroll_offset
2) Drop ScrollClamping argument
In Gecko we didn't use ScrollClamping::ToContentBounds at all
3) The order of arguments of scroll_node_with_id
Differential Revision: https://phabricator.services.mozilla.com/D133145
The default size on most platforms is 256*256 which corresponds to the default blob tile size. I didn't check on android so I set it to 512*512 above which we never batch the upload so that the behavior is unchanged, but I suspect that a smaller threshold like 256*256 would also work better there.
On Windows with heavy blob image workloads, not batching gives a 20%-30% improvement to the time spent in update_texture_cache.
Differential Revision: https://phabricator.services.mozilla.com/D129516
This patch adds plumbing to keep track of why we request frames to be rendered.
This information is then displayed in gecko profile markers on the renderer thread as well as in profiler HUD counters (See "Render reasons" in profiler.rs).
Differential Revision: https://phabricator.services.mozilla.com/D127274
Right now adding a dynamic pref for webrender involves plumbing in gfxPlatform, gfxVars, CompositBridgeParent, WebRenderBridgeParent, WebRenderAPI, the bindings, and then messaging the pref change to the right thread in WebRender.
That's quite a bit time consuming for something we tend to do for multiple things.
We already have a pretty good system for boolean debug prefs where the pref only needs to be listed in gfxPlatform and in the DebugPref enum of webrender_api/lib.rs, which has led us to use it for non-debug purposes.
This patch adds a system similar to the DebugFlags with values passed in a bitfield to be able to use gfxVars. In WebRender the parameters are key-value pairs which flow through the pipeline so that any component can react to them. A followup will add integer parameters.
The patch also moves a few prefs to this system and adds a pref to use PBO uploads.
Differential Revision: https://phabricator.services.mozilla.com/D126100
The prefs name is gfx.webrender.blob-tile-size and can be changed at runtime.
It changes the behavior of a wrench reftest that was ensuring that we don't crash with unreasonable tile sizes. The new behavior (sanitizing the tile size) means we can render the image while we would previously skip it.
Differential Revision: https://phabricator.services.mozilla.com/D124789
Fix a bug where the display item cache was not being reused from
frame to frame with retained display list builders.
At the same time, make the capacity recycling on the display list
serialization arrays a bit more realistic.
Differential Revision: https://phabricator.services.mozilla.com/D124412
In order to support scroll-linked animations, we need the scrolling
information for sampling omt animations, so we would like to do APZ animations
first.
Now we clear the dynamic properties before sampling APZ and OMTA, so we
can make sure the pending properties are empty before appending new
ones. Therefore, let's just replace set_properties with add_properties
because OMTA sampler shouldn't override the current pending properties which
may be added by APZ sampler.
Differential Revision: https://phabricator.services.mozilla.com/D122308
In order to support scroll-linked animations, we need the scrolling
information for sampling omt animations, so we would like to do APZ animations
first.
Now we clear the dynamic properties before sampling APZ and OMTA, so we
can make sure the pending properties are empty before appending new
ones. Therefore, let's just replace set_properties with add_properties
because OMTA sampler shouldn't override the current pending properties which
may be added by APZ sampler.
Differential Revision: https://phabricator.services.mozilla.com/D122308
This will allow storing state in a display list builder struct
between different display list builds. In time, this will be used
to reduce the size of the serialized display list data, by only
sending delta changes to WR. The extra information made available
by sending deltas will then allow WR to more efficiently cache and
reuse information across different scene/frame builds.
Differential Revision: https://phabricator.services.mozilla.com/D123579