Commit Graph

1632 Commits

Author SHA1 Message Date
Andrew Osmond
470d4c6138 Bug 1605642 - Fix glyph distortion during animations. r=lsalzman
When we animate text, we rasterize the glyphs in an arbitrary local
space once, and scale them during the animation. Some glyphs may be
pressed against the edge of the texture, resulting in artifacts due to
how the sampling works in the shader. This patch fixes the sampling
issues by padding glyph textures with an extra transparent pixel border.
This only applies to glyphs that are rasterized in local space.

This patch does not add the extra padding for Mac because it is already
padding its glyphs for Mac-specific reasons, and does not appear to be
as suspectible to the problem.

Differential Revision: https://phabricator.services.mozilla.com/D74457
2020-05-08 20:23:41 +00:00
Jim Blandy
9f699a4611 Bug 1598972: Consider gradients as tile backdrops. r=gw
The fix for bug 1621390 extended the tile backdrop computation to recognize
images. This patch extends that to consider gradients as potential
backdrops as well.

Differential Revision: https://phabricator.services.mozilla.com/D70458
2020-05-07 19:55:24 +00:00
Lee Salzman
185ad4f96e Bug 1636014 - handle signed overflow for SWGL text blend funcs. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D74187
2020-05-08 19:07:08 +00:00
Dzmitry Malyshau
55d40f2461 Bug 1631331 - Handle a case where WebRender can't initialize GPU cache r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D74462
2020-05-08 19:57:36 +00:00
Lee Salzman
d94331c3ca Bug 1635661 - lower interpolant usage in SWGL. r=jrmuizel
Depends on D74000

Differential Revision: https://phabricator.services.mozilla.com/D74001
2020-05-07 03:45:28 +00:00
Lee Salzman
fbab072082 Bug 1635661 - store WR YUV shader layers in flat varying to reduce interpolant usage. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D74000
2020-05-07 04:09:40 +00:00
Lee Salzman
c864b9fc4f Bug 1635649 - optimize texture(sampler2DArray) for same layer in SWGL. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D73993
2020-05-07 04:08:41 +00:00
Lee Salzman
f4e2895339 Bug 1635616 - shuffling optimizations for SWGL x86 bilinear filtering code. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D73979
2020-05-08 09:58:23 +00:00
Bert Peers
b632b808c3 Bug 1628175 - WebGL is drawn into the picture cache and then onto the screen r=gw
Part 2 - look at the resulting transforming of a promoted surface, and
if it a scale and translate, allow compositing.
For RGB surfaces, support a flip_y option to handle the WebGL origin.
DPI is implicitly handled by allocating a DWM surface at device
resolution.

Differential Revision: https://phabricator.services.mozilla.com/D72783
2020-05-07 19:37:27 +00:00
Glenn Watson
e9fb825993 Bug 1634243 - Remove ScrollNodeAndClipChain type from WR internals. r=Bert
The spatial node index and clip chain id are no longer directly
related concepts, since they now exist in different representations
(the spatial tree and clip store).

Removing the grouping of these during scene building simplifies
some work in progress to refactor how WR internally represents
clips, in order to allow future optimization work.

Differential Revision: https://phabricator.services.mozilla.com/D73187
2020-05-04 20:44:24 +00:00
Kartikaya Gupta
2a35f96fd5 Bug 1635430 - Stop running webrender github CI on AppVeyor. r=jdm,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D73881
2020-05-05 15:58:49 +00:00
Dzmitry Malyshau
5fd43ff44d Bug 1634439 - Update RON dependency to 0.5 r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D73291
2020-05-04 18:49:46 +00:00
Glenn Watson
fb839d472b Bug 1635022 - Add support for specifying blend container r=kats,Bert
Previously, WR would internally mark a parent stacking context
as requiring isolation when a stacking context with mix-blend-mode
was encountered.

However, this adds significant complexity to scene building in
WR, meaning that several decisions related to stacking context
redundancy, clip chain roots must be delayed until the stacking
context is popped.

By requiring the display list to annotate blend containers (Gecko
already has all this information available), we will be able to
simplify this scene building logic, which will unblock some
ongoing improvements to how clips are handled.

The patch introduces stacking context flags, and ports the existing
is_backdrop_root bool to be part of these flags. It also removes
an unused old field, cache_tiles.

Differential Revision: https://phabricator.services.mozilla.com/D73597
2020-05-04 20:28:44 +00:00
Bert Peers
49849153e7 Bug 1628175 - WebGL is drawn into the picture cache and then onto the screen r=gw
Part 1 - support RGB external surfaces for promotion to compositor
surfaces; add new shader permutations to handle all buffer kinds.
Set the promotion flag when the pixel format has no alpha, or when the
texture provider can guarantee all-solid alpha values.

Differential Revision: https://phabricator.services.mozilla.com/D71120
2020-04-30 07:08:17 +00:00
Lee Salzman
c828a9b30a Bug 1634130 - avoid 0-length edges in SWGL rasterizer. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D73406
2020-05-01 04:59:08 +00:00
Lee Salzman
50f17f6abd Bug 1634447 - don't generate perspective code if SWGL fragment shader doesn't use it. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D73327
2020-05-01 00:33:39 +00:00
Lee Salzman
d6438ad24b Bug 1634452 - allow SWGL vertex and fragment shaders to share data. r=jrmuizel
Currently SWGL stores separate copies of flat interpolants, uniforms, and samplers for vertex shaders and fragment shaders. We can just make the fragment shader inherit from the vertex shader, which allows us to only have to store one copy of these, and also obviates the need to store them out and read them back to transition from vertex shader to fragment shader per-primitive. This will help offset the performance cost of perspective checking in bug 1634447.

Differential Revision: https://phabricator.services.mozilla.com/D73299
2020-05-01 00:33:21 +00:00
Lee Salzman
f9b1f690e4 Bug 1634447 - allow SWGL shaders to work with and without perspective. r=jrmuizel
Based on ideas discussed to solve bug 1633912, this patch implements allowing each shader to switch between no-perspective and perspective on per-primitive based on whether or not the primitive's W coordinates all match. This should be a sufficient stop-gap for now to unblock testing and development. Performance and memory usage costs of this approach will need to be evaluated before we decide whether to keep it long term.

Differential Revision: https://phabricator.services.mozilla.com/D73298
2020-05-01 00:32:55 +00:00
Lee Salzman
9873811aca Bug 1633953 - refactor draw_quad_spans edge stepping to make it easier to read. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D73041
2020-05-01 00:32:38 +00:00
Lee Salzman
8d59795c6c Bug 1633953 - check for duplicate vertices in SWGL quad rendering. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72989
2020-05-01 00:32:20 +00:00
Jamie Nicol
1af6f33ce1 Bug 1634275 - Update glslopt to 0.1.2 to remove dependency on bindgen. r=jrmuizel,kats
Differential Revision: https://phabricator.services.mozilla.com/D73198
2020-04-30 12:25:17 +00:00
Daniel Varga
d0212aae27 Backed out changeset a8ca75f3002d (bug 1633985) on request by dev 2020-04-30 01:58:25 +03:00
Glenn Watson
ab3883a1e7 Bug 1633985 - Remove unused clip parent and backface flag from push_iframe r=kats,nical
Differential Revision: https://phabricator.services.mozilla.com/D73006
2020-04-29 21:54:14 +00:00
Dorel Luca
f906702a66 Backed out changeset 0a9371673354 (bug 1633985) for Webrender bustages. CLOSED TREE 2020-04-30 00:03:23 +03:00
Glenn Watson
c222acf8ae Bug 1633985 - Remove unused clip parent and backface flag from push_iframe r=kats,nical
Differential Revision: https://phabricator.services.mozilla.com/D73006
2020-04-29 17:14:50 +00:00
Lee Salzman
c3a1a86711 Bug 1633971 - comment SWGL's span rasterizer. DONTBUILD r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D73000
2020-04-29 14:58:54 +00:00
Glenn Watson
e0dc298035 Bug 1633645 - Remove prim_origin from primitive dependency descriptor. r=Bert
It's no longer needed with the recent fix to how rectangle prim
and clip rects are stored. It's also a performance win, reducing
the amount of work done when comparing primitive dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D72794
2020-04-29 00:36:56 +00:00
Brindusan Cristian
f3c4961c6d Backed out changeset e78e8f677ca0 (bug 1633645) for wrench bustage. CLOSED TREE 2020-04-29 00:05:42 +03:00
Glenn Watson
cdb7a90eda Bug 1633645 - Remove prim_origin from primitive dependency descriptor. r=Bert
It's no longer needed with the recent fix to how rectangle prim
and clip rects are stored. It's also a performance win, reducing
the amount of work done when comparing primitive dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D72794
2020-04-28 17:33:21 +00:00
Brindusan Cristian
f33d38c284 Backed out changeset 8433832c8f09 (bug 1628175) for reftest failures at 817019-1.html. CLOSED TREE 2020-04-28 21:33:46 +03:00
Lee Salzman
7f36735222 Bug 1633617 - offset SWGL's linear BlitFramebuffer to texel centers. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72896
2020-04-28 17:36:31 +00:00
Bert Peers
b91a3eabe0 Bug 1628175 - WebGL is drawn into the picture cache and then onto the screen r=gw
Part 1 - support RGB external surfaces for promotion to compositor
surfaces; add new shader permutations to handle all buffer kinds.
Set the promotion flag when the pixel format has no alpha, or when the
texture provider can guarantee all-solid alpha values.

Differential Revision: https://phabricator.services.mozilla.com/D71120
2020-04-27 19:38:02 +00:00
Lee Salzman
418deed8c5 Bug 1633617 - round quantized coordinates in SWGL bilinear filtering. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72782
2020-04-28 03:32:10 +00:00
Josh Matthews
522ffb1f8e Bug 1633557 - Add Serialize/Deserialize for structs needed by Servo. r=jdm
[import_pr] From https://github.com/servo/webrender/pull/3936

Differential Revision: https://phabricator.services.mozilla.com/D72749
2020-04-27 21:06:36 +00:00
Dzmitry Malyshau
8f221fe39d Bug 1633553 - Update dwrote to 0.11 r=jdm
Differential Revision: https://phabricator.services.mozilla.com/D72748
2020-04-27 21:47:21 +00:00
Jamie Nicol
b994c9e30a Bug 1632795 - Ensure invalidate_rendered_frame is not overridden by the frame being a no-op. r=gw
The RenderBackend can be sent an `invalidate_rendered_frame` flag to
indicate that the current rendered frame is invalid. This is useful
when the platform requires a render, eg when starting or resuming the
app on Android. Upon receiving this flag, the render backend will set
a variable `doc.rendered_frame_is_valid = false`. Later on it will
decide to skip rendering only if this variable is true, so by setting
the invalidate flag we should be able to ensure the next render will
occur.

However, the RenderBackend also tries to skip renders which it
determines are not required. Currently it does this by setting
`doc.rendered_frame_is_valid = true` if it decides the frame is a
no-op. This overwrites the previous value set by the
`invalidate_rendered_frame` flag, meaning webrender skips renderering
even though the platform has requested it.

This was resulting in the GVE app showing a black screen on startup,
and Fenix temporarily showing a black screen whilst opening a new tab,
because despite WebRenderBridgeParent requesting an invalidation
immediately on startup, webrender ignored that request until it
decided it actually had content to paint.

To fix this, the logic should be flipped. The value of
`doc.rendered_frame_is_valid` must be remembered across document
updates rather than defaulting to false. And instead of setting it
true if webrender thinks the frame is a no-op, we must set it false if
webrender thinks the frame is *not* a no-op.

Differential Revision: https://phabricator.services.mozilla.com/D72600
2020-04-27 16:28:54 +00:00
Glenn Watson
43db714391 Bug 1632705 - Part 3 - Add API for rounded rect clips. r=Bert
This adds the last remaining explicit API for defining clips of
a specific type, and ports wrench and examples to use them.

Differential Revision: https://phabricator.services.mozilla.com/D72284
2020-04-26 23:30:48 +00:00
Glenn Watson
b954ae4e56 Bug 1632705 - Part 2 - Add display item for rectangle clips. r=nical
This allows defining rectangle clips directly, rather than via
the generic clip region methods.

This patch doesn't make use of it in Gecko yet, but it will do
once we add the remaining rounded rect API.

Differential Revision: https://phabricator.services.mozilla.com/D72268
2020-04-27 09:08:04 +00:00
Glenn Watson
63892870eb Bug 1632705 - Part 1 - Remove complex clips from scroll frame definitions. r=kats,Bert
They aren't used, so can easily be removed as the first part of
this seried of patches.

If this functionality is ever required, it can be handled by the
caller defining complex clip nodes explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D72261
2020-04-24 18:29:38 +00:00
Lee Salzman
086657e157 Bug 1632376 - just scale pixels to integer 255 before rounding. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72095
2020-04-25 17:20:01 +00:00
Lee Salzman
d36a6bffc4 Bug 1632276 - support full-range unsigned int indexes in SWGL DrawElements. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D72035
2020-04-25 17:02:49 +00:00
Nicolas Silva
505c116b8f Bug 1612440 - Discard the SpatialTree's frame state after scene swap. r=gw
The information comes with SetDisplayList messages but was applied before scene building instead of during scene swap, which breaks the transaction model and looks like a bug.

Differential Revision: https://phabricator.services.mozilla.com/D71934
2020-04-23 20:39:35 +00:00
Glenn Watson
31dabce5a8 Bug 1632409 - Separate image mask API from the generic clip API in WR. r=kats
Separating out the generic clip definition API into image masks
(and other types in future) makes the serialized data smaller. More
importantly, it will allow us to simplify some of the WR clip internals
in future and optimize the performance spent in clip chain handling.

Differential Revision: https://phabricator.services.mozilla.com/D72125
2020-04-23 20:44:21 +00:00
Glenn Watson
a252244f3c Bug 1632389 - Remove image mask support from scroll layer API. r=nical
This is not used, so we can remove it as the first part of modifying
the public clip API in order to allow some internal optimizations.

If callers ever want to make use of this in future, it can be
achieved by placing an image mask clip node in the clip chain for
the primitives in the scroll layer.

Differential Revision: https://phabricator.services.mozilla.com/D72099
2020-04-23 11:39:42 +00:00
Jamie Nicol
f9253cf629 Bug 1632444 - Correctly detect target OS when deciding what shaders to optimize. r=jrmuizel
A previous patch attempted to optimize only GL or GLES shaders,
depending on the target platform. However, it was trying to detect the
platform by using `cfg!(target_os = {})`, but as this is in a
build script that actually detects the host platform instead. This
resulted in the wrong version of shaders being optimized, and
therefore falling back to unoptimized shaders at runtime.

This fix uses `env::var("CARGO_CFG_TARGET_OS")` instead, which works
correctly in build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D72127
2020-04-23 12:23:35 +00:00
Nicolas Silva
20be49d861 Bug 1612440 - Separate scene and frame related data in DocumentView. r=gw
DocumentView has a mix of members that affect scene building and memebers that change frame to frame. These need to be updated at different rates and more importantly follow the respective flow of scene and frame transactions, which wasn't done properly before this change.

Depends on D71781

Differential Revision: https://phabricator.services.mozilla.com/D71927
2020-04-22 19:41:21 +00:00
Nicolas Silva
eef976c85a Bug 1612440 - Move some scene-related transaction handling code to the scene builder thread. r=gw
The goal is to move this code out of the render backend to avoid requiring the messages to transit through this thread. Other similar changes are in progress.

Differential Revision: https://phabricator.services.mozilla.com/D71781
2020-04-22 12:04:14 +00:00
Glenn Watson
ff2b478716 Bug 1624988 - Improve inflation factor calculation for drop-shadows. r=kvark
Include the inflation factor from all drop-shadow filters when
calculating the overall inflation factor for a surface.

This doesn't fix cases with large offsets, which is a larger amount
of work to fix, but it fixes the common case and the referenced
case in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D71878
2020-04-22 20:54:55 +00:00
Stefan Hindli
ff96217137 Backed out changeset f75deee57611 (bug 1624988) for wrench bustages CLOSED TREE 2020-04-22 23:42:32 +03:00
Glenn Watson
d251a60158 Bug 1624988 - Improve inflation factor calculation for drop-shadows. r=kvark
Include the inflation factor from all drop-shadow filters when
calculating the overall inflation factor for a surface.

This doesn't fix cases with large offsets, which is a larger amount
of work to fix, but it fixes the common case and the referenced
case in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D71878
2020-04-22 14:26:21 +00:00