EGL with buffer-age requires the application to keep the front buffer
fully consistent. This means we have to draw the previous frame's
damage as well. (But we don't need to include it in the hint we're
sending to the system compositor via SwapBuffersWithDamage.)
Differential Revision: https://phabricator.services.mozilla.com/D61062
This patch separates SceneBuilderRequest into two enums: One we'll be able to send from the api, and containing types that shouldn't move to the webrender_api crate. For example LoadScene depends on the Scene struct and at this point a quarter of webrender's types would need to move to webrender_api.
This solution is a bit iffy but I'm not sure how to better do this. If we don't need strict ordering, moving to crossbeam's queue which support select would let us at least avoid sending dummy BackendMessage to instruct the scene builder thread to look into the other queue.
This patch should not change the current behavior except for one (important) detail: all messages that use BackendSceneBuilderMessage have to go through the low priority scene queue instead of the high priority one. This affects the capture stuff, I think that it's still correct but I'm not familiar enough with it to be sure.
Differential Revision: https://phabricator.services.mozilla.com/D72717
One of the last steps towards letting the api send scene building requests directly. I'll clean up the names after everything is in place.
Differential Revision: https://phabricator.services.mozilla.com/D74054
Some pages created nesting levels of scroll roots where the outer
scroll frames are redundant (the scrollable size is zero if the
content rect is the same as the frame rect).
In these cases, it is of no benefit to select these as a scroll
root for picture cache tiles.
Differential Revision: https://phabricator.services.mozilla.com/D75451
The android emulator appears to have a bug in its OpenGL
implementation where it gets confused about whether a texture is bound
to GL_TEXTURE_EXTERNAL_OES or GL_TEXTURE_2D. This was causing spurious
errors when attempting to use a regular 2D texture, due to the fact
that an external texture had previously been bound.
Work around this by explicitly unbinding from GL_TEXTURE_EXTERNAL_OES
immediately before binding to GL_TEXTURE_2D.
Differential Revision: https://phabricator.services.mozilla.com/D76318
Some pages created nesting levels of scroll roots where the outer
scroll frames are redundant (the scrollable size is zero if the
content rect is the same as the frame rect).
In these cases, it is of no benefit to select these as a scroll
root for picture cache tiles.
Differential Revision: https://phabricator.services.mozilla.com/D75451
Previously, WR would attempt to detect at the start of frame
building if the spatial node of any picture cache contained
a non-axis-aligned transform, and disable picture caching in
that edge case.
However, picture caching can't (currently) be disabled when the
native compositor is active. In this mode, picture caching was
force enabled, causing an assertion failure due to unexpected
coordinate systems when updating pictures.
This patch changes the way the detection of scroll root logic
works such that we don't consider any scroll frame inside a
reference frame to be a valid scroll root for picture caching
purposes. Thus it's not possible to create a picture cache
where the reference spatial node has a non-axis-aligned transform.
Differential Revision: https://phabricator.services.mozilla.com/D75890
Ensure that clips from an enclosing stacking context are correctly
propagated to nested iframes, and add a regression test for this.
Differential Revision: https://phabricator.services.mozilla.com/D76075
This patch adjusts the device pixel scale for raster root surfaces so that the surface's content is not
pixelated/blurred when it is composited into its parent surface where a transform scales up the surface.
This only fixes the referenced bug when WebRender is used.
Differential Revision: https://phabricator.services.mozilla.com/D75236
WR currently disables picture caching during a pinch-zoom, if the
native compositor is disabled (since there's no real performance
gain to be had from caching tiles during a pinch-zoom).
However, this code path was not returning a dirty rect to the
caller code. For callers that take advantage of partial present,
this meant the screen was assumed to have no changes, and so
the swapbuffers is skipped incorrectly.
Differential Revision: https://phabricator.services.mozilla.com/D76081
This patch adjusts the device pixel scale for raster root surfaces so that the surface's content is not
pixelated/blurred when it is composited into its parent surface where a transform scales up the surface.
This only fixes the referenced bug when WebRender is used.
Differential Revision: https://phabricator.services.mozilla.com/D75236
This prevents the request from racing ahead of the AddFontInstance message which follows the transaction through the scene builder thread and silently returning zero-sized glyphs.
Differential Revision: https://phabricator.services.mozilla.com/D72906
Some pages created nesting levels of scroll roots where the outer
scroll frames are redundant (the scrollable size is zero if the
content rect is the same as the frame rect).
In these cases, it is of no benefit to select these as a scroll
root for picture cache tiles.
Differential Revision: https://phabricator.services.mozilla.com/D75451
Part 1 of this patch enables subpixel AA in more cases when there
are multiple picture cache slices. Because of this, we can enable
extra picture cache slices by default, as a performance win for
the general case.
Users who want to force subpixel AA in more cases, at the cost of
performance can manually set the about:config value called
gfx.webrender.quality.force-subpixel-aa-where-possible.
Differential Revision: https://phabricator.services.mozilla.com/D75465
1/ add tile_cache to input path if frame00000 can't be found
2/ add visual IDs to each tile
3/ hiding a slice also hides its Invalidation info
4/ code cleanup (+= instead of push_str)
Differential Revision: https://phabricator.services.mozilla.com/D75432
The fill area is a bit special because its repetition parameters depend on the top-left corner dimensions, but the stretch size in the shader must only be modified to account for this if the image is repeated.
Differential Revision: https://phabricator.services.mozilla.com/D75117
The fill area is a bit special because its repetition parameters depend on the top-left corner dimensions, but the stretch size in the shader must only be modified to account for this if the image is repeated.
Differential Revision: https://phabricator.services.mozilla.com/D75117
Previously, any time a text run was encountered that was outside the
detected opaque backdrop of a picture cache, all subpixel AA would
get disabled for that surface.
Recently, we added support for conditional subpixel mode, where a
list of excluded rects can be provided (compositor surfaces) that
require a text run to disable subpixel AA.
This patch extends that, adding an inclusion rect to the conditional
subpixel mode. This allows subpixel AA to be enabled on any text
runs that are within the bounds of the detected opaque backdrop
for a picture cache.
Differential Revision: https://phabricator.services.mozilla.com/D75027
It's very common for content to share a ClipId with the previous
primitive. This patch adds a cache of the last clip chain that
was built, and reuses it if the next ClipId is the same.
If we ever see this show up in future profiles, we could make
the cache a hash map, rather than just the previous ClipId.
Fixes the talos regressions from the recent clip restructuring.
Differential Revision: https://phabricator.services.mozilla.com/D75002
If we pass an array of glyph IDs (all the same) and positions (with 1-pixel offsets) to CTFontDrawGlyphs
to generate the rasterized image for a synthetic-bold glyph, it's possible that -- depending on the
fractional-pixel x position and the character coverage of the font -- it may misposition the rendering
of one (or more?) of the copies of the glyph bitmap within the context, such that we lose the intended
double-struck/offset effect.
The problem doesn't occur if we render the exact same glyphs and positions to the context using
individual single-glyph calls to CTFontDrawGlyphs.
Differential Revision: https://phabricator.services.mozilla.com/D74918
On some pages, primitives other than rectangles may have their
clip rect affected by the display port, which was causing incorrect
invalidations and extra rasterization work.
Remove clip_by_tile check, and clamp clip rect to tile boundaries
for all primitive types. Also switch to a more efficient min/max
representation of the clip rect for primitive dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D74582
Building on the work in parts 1 and 2, the Push/PopClipChain
display items are no longer required.
Instead, we can use the clip chain builder to push the clip
from any redundant stacking contexts onto the clip stack. This
ensures that primitives within the redundant stacking context
will get that clip applied to the primitive.
This also relies on being able to determine if a stacking
context is redundant during push_stacking_context. Previously
this was not feasible due to mix-blend-mode changing the
isolation mode of parent stacking context. However, this is
now known due to recent work to support blend containers.
This patch doesn't contain functional changes, but should be
a slight performance improvement during both scene building
and frame building. It also simplifies a lot of the clip
handling code related to picture caching, opening up some
more optimization opportunities in future.
Differential Revision: https://phabricator.services.mozilla.com/D74583