This approach does have some stacking issues. The way to fix this would
be to instrument the brush_image shader rather than adding debug rects.
Something like: #ifdef WR_FEATURE_SFW frag.color = vec4(0,1,1,1); #endif
That's slightly more involved though, so I'm going to leave it for now.
Differential Revision: https://phabricator.services.mozilla.com/D47155
--HG--
extra : moz-landing-system : lando
As it turns out, the difference between the snapped local rect and the
unsnapped local rect was not just that the former contained snapped
primitives and the latter contained unsnapped primitives, but also that
the former took into account surface inflation for primitives, the
entire clip chain instead of just the primitive's local clip, and
removal of culled primitives. As such, the picture's rects can be wildly
different, even if snapping has been taken care of earlier, and parts of
WebRender have come to rely upon this more accurate representation of a
picture.
Differential Revision: https://phabricator.services.mozilla.com/D46605
--HG--
extra : moz-landing-system : lando
Adds a module documentation in segment.rs giving an overview of the role of primitive segments and how they interact with clipping. Also reformatted the clip.rs documentation to play well with rustdoc.
Differential Revision: https://phabricator.services.mozilla.com/D46472
--HG--
extra : moz-landing-system : lando
As it turns out, the difference between the snapped local rect and the
unsnapped local rect was not just that the former contained snapped
primitives and the latter contained unsnapped primitives, but also that
the former took into account surface inflation for primitives, the
entire clip chain instead of just the primitive's local clip, and
removal of culled primitives. As such, the picture's rects can be wildly
different, even if snapping has been taken care of earlier, and parts of
WebRender have come to rely upon this more accurate representation of a
picture.
Differential Revision: https://phabricator.services.mozilla.com/D46605
--HG--
extra : moz-landing-system : lando
As it turns out, the difference between the snapped local rect and the
unsnapped local rect was not just that the former contained snapped
primitives and the latter contained unsnapped primitives, but also that
the former took into account surface inflation for primitives, the
entire clip chain instead of just the primitive's local clip, and
removal of culled primitives. As such, the picture's rects can be wildly
different, even if snapping has been taken care of earlier, and parts of
WebRender have come to rely upon this more accurate representation of a
picture.
Differential Revision: https://phabricator.services.mozilla.com/D46605
--HG--
extra : moz-landing-system : lando
Adds a module documentation in segment.rs giving an overview of the role of primitive segments and how they interact with clipping. Also reformatted the clip.rs documentation to play well with rustdoc.
Differential Revision: https://phabricator.services.mozilla.com/D46472
--HG--
extra : moz-landing-system : lando
Fix scissor rect being incorrect during pinch zoom due to floating
point inaccuracies.
Differential Revision: https://phabricator.services.mozilla.com/D46743
--HG--
extra : moz-landing-system : lando
We only use the png codec so let's save some link time by not including
the other codecs.
Differential Revision: https://phabricator.services.mozilla.com/D46317
--HG--
extra : moz-landing-system : lando
Previously, the setup_picture_caching function was hard coded
to support only a very specific shape of display list. With this
change, flags are added to PrimitiveCluster that can specify
if a picture cache slice should be created before / after this
cluster when picture caching is set up.
The usage of these flags in this patch matches the old behaviour,
so should not have any functional effect.
However, in future we will make use of this functionality to
create picture slices for a number of different use cases, such as:
* Creating cache tiles for the UI.
* Slicing the scene where there are video elements, in order to
allow these to be composited directly by the OS. This may also
apply to WebGL and/or canvas elements.
* Slicing the scene when there is a very large fixed position
background image or other element, to avoid invalidating the
entire tile cache each frame.
Differential Revision: https://phabricator.services.mozilla.com/D46125
--HG--
extra : moz-landing-system : lando
This fixes a case where the is_same_content field was no longer
being reset to true before dependency calculation could occur.
In some cases, this could result in a tile being updated, but
the dirty rect being empty, which meant all primitives in that
tile would fail the visibility culling test.
Differential Revision: https://phabricator.services.mozilla.com/D46247
--HG--
extra : moz-landing-system : lando
This patch replaces the is_backface_visible bool in the common
per-primitive data in the display list with a PrimitiveFlags
enumeration. This will allow Gecko to specify extra information
about certain primitive, such as tagging scroll bars.
Differential Revision: https://phabricator.services.mozilla.com/D45970
--HG--
extra : moz-landing-system : lando
This provides the internal device-space dirty rects calculated
during picture cache updates to the external render() method.
This allows clients to provide these to OS partial present APIs,
to reduce power usage and improve performance.
In this initial implementation, if a scroll or scale of the main
picture cache has occurred, the dirty rect will be the entire
screen. This should ensure correctness. In future, we can handle
this case by supplying the picture cache transforms to the OS
compositor integration.
However, the dirty rects will be valid for any non-scroll cases,
such as animations or video playback. This should result in some
significant power savings and performance improvements for these
use cases.
Differential Revision: https://phabricator.services.mozilla.com/D46082
--HG--
extra : moz-landing-system : lando
This patch replaces the is_backface_visible bool in the common
per-primitive data in the display list with a PrimitiveFlags
enumeration. This will allow Gecko to specify extra information
about certain primitive, such as tagging scroll bars.
Differential Revision: https://phabricator.services.mozilla.com/D45970
--HG--
extra : moz-landing-system : lando
Previously, primitive lists were stored as:
PicturePrimitive
PrimitiveList
[PrimitiveInstance]
[PrimitiveCluster]
[PictureIndices]
Each primitive instance contained a spatial node index and an
index into the primitive cluster it belongs to.
Now, the instances in a primitive list are stored as:
PicturePrimitive
PrimitiveList
[PrimitiveCluster]
[PrimitiveInstance]
This provides a number of advantages:
* Size of the PrimitiveInstance struct is smaller.
* No need to maintain a separate PictureIndices list.
* Easy and fast to skip the array, finding pictures or scroll root changes.
* Much faster to split and reorder PrimitiveList structures.
This patch is refactoring only, it doesn't contain any functional
changes. As we enable multiple picture caching slices, we need to
be able to split and reorder PrimitiveLists. Storing the primitive
instances in this way makes that process much more efficient than
it currently is.
Differential Revision: https://phabricator.services.mozilla.com/D45636
--HG--
extra : moz-landing-system : lando
The snapping during scene building is unable to take into account scroll
offsets. Since we have already snapped the primitive rects in the raster
space, we know that this can only result in a translation rather than a
size change, and thus is safe to do during frame building.
When we update the transform tree, we now snap the scroll offset in
device space to ensure that scroll offsets should primarily be integer
offsets and not have snapping implications.
The local rect of a picture is calculated during the first picture
traversel. It is composed of already snapped primitives, however the
picture itself may inflate itself, and thus is now snapped again as part
of inflation.
Differential Revision: https://phabricator.services.mozilla.com/D45060
--HG--
extra : moz-landing-system : lando
Now that rounding has been removed from Gecko, we need to start snapping
properly in WebRender. Snapping can change the size of a primitive, and
thus it is problematic to do any later than scene building due to the
GPU caching and sharing of data between clips and such that only differ
in their positioning.
This patch produces a snapping transform which allows any primitive to
snap using information known during scene building. This excludes
animated tranforms which are assumed to be the identity. This allows for
primitives that are marked as will-change: transform but given no
initial transform to render the same as primitives that are not. This
also excludes scroll positioning because that is not known until frame
building. A follow up patch will deal with that.
Differential Revision: https://phabricator.services.mozilla.com/D45059
--HG--
extra : moz-landing-system : lando
This will be rewritten in a later patch in the series. The shaders will
be provided the correct information and will no longer need to concern
themselves with snapping.
Differential Revision: https://phabricator.services.mozilla.com/D45057
--HG--
extra : moz-landing-system : lando
Repeating/background images may have extra parameters such the stretch
size and tile spacing, that non-repeating images do not require. By
splitting these apart, we can make it easier to infer what we should do
if snapping changes the size of an image primitive, in addition to
reducing the display list size for non-repeating images.
Differential Revision: https://phabricator.services.mozilla.com/D45056
--HG--
extra : moz-landing-system : lando
The snapping during scene building is unable to take into account scroll
offsets. Since we have already snapped the primitive rects in the raster
space, we know that this can only result in a translation rather than a
size change, and thus is safe to do during frame building.
When we update the transform tree, we now snap the scroll offset in
device space to ensure that scroll offsets should primarily be integer
offsets and not have snapping implications.
The local rect of a picture is calculated during the first picture
traversel. It is composed of already snapped primitives, however the
picture itself may inflate itself, and thus is now snapped again as part
of inflation.
Differential Revision: https://phabricator.services.mozilla.com/D45060
--HG--
extra : moz-landing-system : lando