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
In certain situations (such as a print preview dialog, with fission
enabled, where an iframe spans a page), the display list contains
a reference to the same iframe multiple times.
Handle this in WR by namespacing the spatial id (via a stack as
iframes are traversed) and uid (by iframe pipeline instance id).
This is more of a band-aid fix than a proper fix - we need to
rethink how we handle spatial mapping properly with iframe
instances.
Differential Revision: https://phabricator.services.mozilla.com/D132661
It is helpful if window visibility state could be checked by debug overlay.
For now, it works only on Windows with compositor.
Differential Revision: https://phabricator.services.mozilla.com/D131807
Unfortunately this is not currently maintained (it's been broken
since the addition of sub_slice compositor surface support).
It's also complicating efforts underway to refactor the way that
picture cache dependencies are handled as part of the visibility
pass refactoring work.
For these reasons, let's remove this functionality. If we find
someone with time to maintain it in future, it's likely that we
could restore most of the viewer code, and update the picture
cache code in WR to output the appropriate information.
Differential Revision: https://phabricator.services.mozilla.com/D131105
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
With this change, the spatial tree is no longer rebuilt
every time a new display arrives and a scene is built.
Instead, scene building maintains a hash map of spatial
node keys <-> indices, allowing any spatial node that
has been recently seen in a display list to be retained.
Scene building then checks if the node is equivalent or
has been modified since the last display list, and sends
these delta changes as part of the scene swap to the
frame building code. The frame building code applies
the deltas to each updated spatial node.
The primary benefits of this are:
- Spatial node indices are now stable across display lists,
allowing future interning of primitives and clips to
include the spatial node. This can be used for various
optimizations, including interning during DL building,
caching transform state, reducing size of PrimitiveInstance
- Frame building now knows exactly which spatial nodes are
new, removed, updated or unchanged. We can make this of
this to cache a lot of the (mostly) redundant calculations
that are done during both scene and frame building.
Differential Revision: https://phabricator.services.mozilla.com/D127902
With this change, the spatial tree is no longer rebuilt
every time a new display arrives and a scene is built.
Instead, scene building maintains a hash map of spatial
node keys <-> indices, allowing any spatial node that
has been recently seen in a display list to be retained.
Scene building then checks if the node is equivalent or
has been modified since the last display list, and sends
these delta changes as part of the scene swap to the
frame building code. The frame building code applies
the deltas to each updated spatial node.
The primary benefits of this are:
- Spatial node indices are now stable across display lists,
allowing future interning of primitives and clips to
include the spatial node. This can be used for various
optimizations, including interning during DL building,
caching transform state, reducing size of PrimitiveInstance
- Frame building now knows exactly which spatial nodes are
new, removed, updated or unchanged. We can make this of
this to cache a lot of the (mostly) redundant calculations
that are done during both scene and frame building.
Differential Revision: https://phabricator.services.mozilla.com/D127902
ScrollSensitivity is not used by Gecko. Also remove some remnants
of the old code to combine scroll frames when display lists swap.
Differential Revision: https://phabricator.services.mozilla.com/D127609
The ability to restrict hit-tests by pipeline_id isn't used by
Gecko or wrench. Remove it to simplify landing some of the upcoming
spatial tree work.
Differential Revision: https://phabricator.services.mozilla.com/D127608
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
This patch makes the SceneSpatialTree be retained by the scene
Document structure, and the SpatialTree be retained by the
RenderBackend structure.
This is exactly the same structure as the interning system uses:
- The SceneSpatialTree is mutated as a new scene is built
- A set of "deltas" is calculated and stored in SpatialTreeUpdates
- The SpatialTreeUpdates are stored in a BuiltTransaction
- The SpatialTreeUpdates are applied to the SpatialTree on scene swap
For now, the "deltas" are simply a complete list of spatial nodes,
which retains existing behavior. In future, this will contain actual
deltas, based on the unique spatial node keys that now exist.
Also update the capture/replay functionality to (de)serialize both
the retained scene and frame versions of the spatial tree.
Differential Revision: https://phabricator.services.mozilla.com/D127021
We need to do this mapping in order to allow primitive interning during
the DL building stage. In future, we might remove this altogether and
have Gecko supply reference-frame-relative coordinates.
Differential Revision: https://phabricator.services.mozilla.com/D126750
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
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
Add an interface (and update Gecko to provide) a stable unique
identifier for each spatial node that is consistent across
display lists.
Although this patch doesn't _do_ anything useful with this yet,
we'll use this in future to allow interning, persisting and caching
a lot more information related to primitives and clips.
For now, it just asserts that the calling code never supplies a
duplicate unique identifier - which will be useful to have running
in nightly for a couple of weeks before starting to make use of
these identifiers.
Differential Revision: https://phabricator.services.mozilla.com/D123177
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.
As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.
Differential Revision: https://phabricator.services.mozilla.com/D122183
Add an interface (and update Gecko to provide) a stable unique
identifier for each spatial node that is consistent across
display lists.
Although this patch doesn't _do_ anything useful with this yet,
we'll use this in future to allow interning, persisting and caching
a lot more information related to primitives and clips.
For now, it just asserts that the calling code never supplies a
duplicate unique identifier - which will be useful to have running
in nightly for a couple of weeks before starting to make use of
these identifiers.
Differential Revision: https://phabricator.services.mozilla.com/D123177
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.
As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.
Differential Revision: https://phabricator.services.mozilla.com/D122183
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.
As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.
Differential Revision: https://phabricator.services.mozilla.com/D122183
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.
As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.
Differential Revision: https://phabricator.services.mozilla.com/D122183
Move the extra_data to be a specific cache_data separate vec in
the display list payload.
This shouldn't change any functionality, but serves as a proof
of concept for future changes which will introduce several other
separated payload vectors.
Differential Revision: https://phabricator.services.mozilla.com/D121937
Although this currently only contains the existing data u8 vec of
serialized bytes, it will allow us to expand this structure in
future to contain other byte arrays.
This will be used for storing other payload information, such as
interned primitive types or data updates.
Differential Revision: https://phabricator.services.mozilla.com/D121160
This was used when defining scroll layers and also backdrop-filter.
Removing it from the scroll layer API allows removal of the implicit
clip rect that a scroll node previously created (Gecko doesn't use
this). To maintain compatibility with wrench tests, add a flag that
allows a test to specify a clip rect should be created for the scroll
layer (we should remove this from wrench in future and port the tests
to create explicit clip rects as required).
The usage of backdrop-filter was the only remaining place this type
was used, so it's now ported to use the clip-chain API.
This simplifies the scroll layer API and removes an extra clip rect
from each scroll layer instance, as a small performance improvement.
Differential Revision: https://phabricator.services.mozilla.com/D119938
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
references'.
Differential Revision: https://phabricator.services.mozilla.com/D115298
Starting to simplify which parts of the composite state will require
true world coordinates compared to those that can operate in local
(pre-compositor-transform) coordinates.
Differential Revision: https://phabricator.services.mozilla.com/D116183
It was always one (previous commits removed the public API for changing
it). The use of global_device_pixel_scale from the remaining code will be
removed in follow up patches.
Differential Revision: https://phabricator.services.mozilla.com/D116175
This patch introduces a simple culling algorithm that splits compositor tiles into only their visible parts, removing the need for a depth buffer. This reduces the draw-call count as well well as the memory usage and bandwidth associated with the depth buffer.
Differential Revision: https://phabricator.services.mozilla.com/D113532
This patch defines a SetPoints DisplayItem for providing polygon mask points
associated with a ImageMaskClipDisplayItem. It also defines a WR enum for the
polygon fill rule. The method to provide these values to WR is mere scaffolding
until later patches in this series.
Differential Revision: https://phabricator.services.mozilla.com/D105396
This patch defines a SetPoints DisplayItem for providing polygon mask points
associated with a ImageMaskClipDisplayItem. It also defines a WR enum for the
polygon fill rule. The method to provide these values to WR is mere scaffolding
until later patches in this series.
Differential Revision: https://phabricator.services.mozilla.com/D105396
This patch defines a SetPoints DisplayItem for providing polygon mask points
associated with a ImageMaskClipDisplayItem. It also defines a WR enum for the
polygon fill rule. The method to provide these values to WR is mere scaffolding
until later patches in this series.
Differential Revision: https://phabricator.services.mozilla.com/D105396
This patch defines a SetPoints DisplayItem for providing polygon mask points
associated with a ImageMaskClipDisplayItem. It also defines a WR enum for the
polygon fill rule. The method to provide these values to WR is mere scaffolding
until later patches in this series.
Differential Revision: https://phabricator.services.mozilla.com/D105396
This patch defines a SetPoints DisplayItem for providing polygon mask points
associated with a ImageMaskClipDisplayItem. It also defines a WR enum for the
polygon fill rule. The method to provide these values to WR is mere scaffolding
until later patches in this series.
Differential Revision: https://phabricator.services.mozilla.com/D105396
We seem to be hitting a surprising amount of allocator contention just allocating
and converting the CString inside CrashAnnotationGuard. This just modifies the
previous patch to cache that conversion so that we never have to do it dynamically.
Differential Revision: https://phabricator.services.mozilla.com/D111537