Commit Graph

1382 Commits

Author SHA1 Message Date
Glenn Watson
36a99a2cba Bug 1579235 - Part 11 - Refactor how external surfaces are composited. r=Bert,sotaro
This patch refactors how external surfaces are stored in the
CompositeState structure. This is primarily to simplify integration
with native compositor mode, but also simplifies the Draw compositor
path.

Previously, the ResolvedExternalSurface struct contained information
that was used to rasterize the external surface (YUV planes etc) and
also the information to composite it (device rect, clip rect, z_id).

Now, ResolvedExternalSurface contains just the information required
to rasterize the external surface, while the compositing information
is handled by adding the external surface as a regular tile. This
makes it possible to unify how external surfaces are drawn, via the
common draw_tile_list method.

Differential Revision: https://phabricator.services.mozilla.com/D65269

--HG--
extra : moz-landing-system : lando
2020-03-05 20:45:15 +00:00
Kartikaya Gupta
8ffc35b01e Bug 1619393 - Increase fuzz by one to allow reftest to pass on AppVeyor. r=Bert
Differential Revision: https://phabricator.services.mozilla.com/D65513

--HG--
extra : moz-landing-system : lando
2020-03-05 18:23:38 +00:00
Tim Nguyen
ef0ca57a42 Bug 1616255 - Handle start and end offsets in conic-gradient WR shader. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D65391

--HG--
extra : moz-landing-system : lando
2020-03-05 00:03:05 +00:00
Bert Peers
5f77fad7a4 Bug 1619393 - Reftest improvements for fuzzy tests r=gw
Add support for a `fuzzy-range` keyword in reftest.list.
It is similar to `fuzzy` but it allows multiple pairs of
`max_difference, num_differences` numbers that introduce
multiple buckets of allowed differences.

For example, `fuzzy-range(5,100,20,10)` allows at most
100 pixels with a difference of at most 5, _plus_ an extra
10 pixels at most that have a difference more than 5 but
less than or equal to 20.
The total number of differing pixels allowed is thus 110,
but only if 100 of those differ by <= 5 and the remaining
10 by <= 20.
110 pixels with a difference <= 5 will still fail.
This is intentional to encourage tighter bounds in tests
where many pixels are slightly off and a few outliers are
off by a lot.

The number of parameters is arbitrary; longer lists can
get confusing so this change also introduces optional
support for writing `<=` in front of the max difference
and `*` in front of the max pixel count, eg.
`fuzzy-range(<=5,*100,<=20,*10)` (no spaces).

Any pixels that exceed the highest maximum will fail the
test, similar to `fuzzy`.

Steps tested:
1. the same tests fail in exactly the same way before and after;
2. reordered the `fuzzy` statements for raster_root_A/B/C to no longer
   be sorted by max difference, and verified that the tests pass/fail
   the same way;
   (then sort them again which is easier to understand);
3. tests using the new feature still fail when the ref no longer matches
   (deliberately broke the _ref version and verified test failed);

Differential Revision: https://phabricator.services.mozilla.com/D65247

--HG--
extra : moz-landing-system : lando
2020-03-04 23:07:29 +00:00
Glenn Watson
cf6ebbb053 Bug 1579235 - Part 10 - Fix incorrect skipping of composites. r=Bert
Ensure that the image keys and image generations for external
compositor surfaces are included in the composite descriptor,
which is used to determine if a composite is required or can
be skipped.

Differential Revision: https://phabricator.services.mozilla.com/D65216

--HG--
extra : moz-landing-system : lando
2020-03-03 23:32:51 +00:00
Jim Blandy
7db1aac145 Bug 1618319: Segregate intern::UpdateList insertions and removals. r=gw
Rather than treating webrender::intern::UpdateList as a sequence of operations,
each of which might be an insertion or a removal, and using a side table to
supply extra data for insertions, it's simpler to segregate insertions and
removals into two separate vectors. This avoids the need for an enum whose
discriminant needs to be checked within the loop, and allows a few loops that
are only looking for one kind of operation to skip over the others entirely.

Ultimately, there should be no change in the order in which operations occur. In
practice, the old UpdateList always held a contiguous run of insertions,
followed by a run of removals (removals are consumed by apply_updates directly
after being generated by end_frame_and_get_pending_updates).

Differential Revision: https://phabricator.services.mozilla.com/D64444

--HG--
extra : moz-landing-system : lando
2020-02-27 02:26:09 +00:00
Kartikaya Gupta
691e4ca68d Bug 1613260 - Increase allowed fuzz on new tests so they pass in AppVeyor CI. r=Bert
Differential Revision: https://phabricator.services.mozilla.com/D65164

--HG--
extra : moz-landing-system : lando
2020-03-03 18:03:22 +00:00
Kartikaya Gupta
41606ddbd6 Bug 1619293 - Re-enable rust flags in github CI. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D65007

--HG--
extra : moz-landing-system : lando
2020-03-02 23:56:27 +00:00
Bert Peers
447713c3c6 Bug 1613260 - Support per-task scale for local space rasterization r=gw,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D63434

--HG--
extra : moz-landing-system : lando
2020-03-03 00:31:09 +00:00
Glenn Watson
a81677d49e Bug 1579235 - Part 9 - Optimize compositor surface overlays. r=Bert
This patch improves the performance of compositor surfaces in
two ways:

(1) Ignore primitives behind the first compositor surface when
    determining whether a tile needs to be moved to the overlay
    (alpha) pass. This means WR only moves a tile to the alpha
    pass when it has primitives that overlap with the compositor
    surface bounding rect, and are ordered after that compositor
    surface. In practice, this means most tiles are able to
    remain in the fast (opaque) path. Typically, a small number
    of tiles that contain overlay video controls are moved to the
    alpha pass.

(2) Register the opaque compositor surfaces as potential occluders.
    This allows tiles that are completely covered by a compositor
    surface to be removed from the compositor visual tree, which
    helps both the simple and native compositor modes.

Between them, these optimizations typically mean that when watching
video in full-screen, nothing is composited except the video surface
itself, and some small region(s) where video overlay controls are
currently active.

Differential Revision: https://phabricator.services.mozilla.com/D64909

--HG--
extra : moz-landing-system : lando
2020-03-02 21:50:25 +00:00
Kartikaya Gupta
c28403de9f Bug 1619265 - Bump rust versions for github CI. r=jrmuizel
The appveyor.yml change bumps it for windows. The macOS worker has the
rust version bumped out-of-band and the change to .taskcluster.yml just
updates the documentation.

Differential Revision: https://phabricator.services.mozilla.com/D64945

--HG--
extra : moz-landing-system : lando
2020-03-02 14:57:16 +00:00
Glenn Watson
a3ebba13e7 Bug 1579235 - Part 8 - Remove overlay tiles, they can be alpha tiles instead. r=nical
A previous patch in this series introduced overlay tiles. However,
now that native surfaces exist for for the opaque and alpha tiles
within a slice, we can remove the overlay tiles array and add
these special tiles to the alpha surface.

Differential Revision: https://phabricator.services.mozilla.com/D64899

--HG--
extra : moz-landing-system : lando
2020-03-02 10:07:23 +00:00
Glenn Watson
f0a3f65d68 Bug 1579235 - Part 7 - Fix UV rect calculation for external textures. r=Bert
This patch fixes an oversight in part 5 of this patch series that
could result in an incorrect UV rect being used for an external
texture that uses a custom UV rect.

When the texture is an external texture, the UV rect is not known when
the external surface descriptor is created, because external textures
are not resolved until the lock() callback is invoked at the start of
the frame render. To handle this, query the texture resolver for the
UV rect if it's an external texture, otherwise use the default UV rect.

Differential Revision: https://phabricator.services.mozilla.com/D64687

--HG--
extra : moz-landing-system : lando
2020-03-01 03:56:02 +00:00
Glenn Watson
b82a921002 Bug 1579235 - Part 6 - Support an opaque/alpha native surface per slice. r=Bert
Previously, a native compositor surface was considered to be
completely opaque, or completely translucent. This is due to
a limitation in how alpha is handled in the DirectComposition
API level.

With this patch, each picture cache slice maintains both an
opaque and translucent native surface handle. Tiles are assigned
to one of those surfaces based on their current opacity.

This is a performance optimization in some cases, since:
 - Even if part of a cache is translucent, opaque tiles can
   still participate in occlusion at the compositor level.
 - If a tile is changing from opaque to translucent, it now
   invalidates only that tile, rather than the entire surface.

The primary benefit of this patch is that it allows compositor
surfaces to be drawn sliced in between the opaque surface and
any overlay / alpha tiles.

Differential Revision: https://phabricator.services.mozilla.com/D64495

--HG--
extra : moz-landing-system : lando
2020-03-01 03:55:54 +00:00
cbrewster
eeba610e4b Bug 1596513: Part 3: Ensure drop shadow blur radius does not exceed MAX_BLUR after scale factors are applied r=gfx-reviewers,nical
This was causing one of the large drop-shadow wrench reftests to timeout.
This is only a partial fix, as we should be checking the scale factors earlier on when sanitizing the
filter input. This will ensure we match what the non-WR backend is doing and will prevent overinflation.

Differential Revision: https://phabricator.services.mozilla.com/D64197

--HG--
extra : moz-landing-system : lando
2020-02-28 17:39:05 +00:00
cbrewster
eed2534a96 Bug 1596513: Part 1: Take scale factors into account when rendering drop shadows in WebRender r=gfx-reviewers,kvark
Differential Revision: https://phabricator.services.mozilla.com/D63441

--HG--
extra : moz-landing-system : lando
2020-02-28 17:09:44 +00:00
Jonathan Kew
f7cf3de506 Bug 1616995 - patch 2 - Support vertical skew for upright-vertical fonts in webrender. r=lsalzman
Depends on D63893

Differential Revision: https://phabricator.services.mozilla.com/D64746

--HG--
extra : moz-landing-system : lando
2020-02-28 15:36:19 +00:00
Hiroyuki Ikezoe
1f0f5d6c7d Bug 1510030 - Implement WebRender backend to run background color animations on the compositor. r=gw,boris
Differential Revision: https://phabricator.services.mozilla.com/D63604

--HG--
extra : moz-landing-system : lando
2020-02-27 08:43:06 +00:00
Hiroyuki Ikezoe
46d186c5a9 Bug 1510030 - Make prepare_prim_for_render private. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63603

--HG--
extra : moz-landing-system : lando
2020-02-27 08:41:41 +00:00
Hiroyuki Ikezoe
e613c8db33 Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63601

--HG--
extra : moz-landing-system : lando
2020-02-27 08:41:28 +00:00
Hiroyuki Ikezoe
945e7ee0c9 Bug 1510030 - Don't return the current opacity value from update_opacity_binding. r=gw
The return value is not used at all.

Differential Revision: https://phabricator.services.mozilla.com/D63600

--HG--
extra : moz-landing-system : lando
2020-02-27 08:41:13 +00:00
Bogdan Tara
0ed6b9ff60 Backed out 6 changesets (bug 1510030) for test_running_on_compositor.html failures CLOSED TREE
Backed out changeset a14a131ca731 (bug 1510030)
Backed out changeset a75359516fec (bug 1510030)
Backed out changeset a2be11cbe3f2 (bug 1510030)
Backed out changeset b37ce2b87ac7 (bug 1510030)
Backed out changeset 781cd96dd9a2 (bug 1510030)
Backed out changeset b3dfa17c6305 (bug 1510030)
2020-02-27 06:28:31 +02:00
Hiroyuki Ikezoe
28f8909e89 Bug 1510030 - Implement WebRender backend to run background color animations on the compositor. r=gw,boris
Differential Revision: https://phabricator.services.mozilla.com/D63604

--HG--
extra : moz-landing-system : lando
2020-02-27 03:47:21 +00:00
Hiroyuki Ikezoe
cb65216c78 Bug 1510030 - Make prepare_prim_for_render private. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63603

--HG--
extra : moz-landing-system : lando
2020-02-27 03:47:08 +00:00
Hiroyuki Ikezoe
b04993947c Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63601

--HG--
extra : moz-landing-system : lando
2020-02-27 03:46:50 +00:00
Hiroyuki Ikezoe
cf5b8449b8 Bug 1510030 - Don't return the current opacity value from update_opacity_binding. r=gw
The return value is not used at all.

Differential Revision: https://phabricator.services.mozilla.com/D63600

--HG--
extra : moz-landing-system : lando
2020-02-27 03:46:38 +00:00
Bogdan Tara
a6ca41945c Backed out 6 changesets (bug 1510030) for webrender bustages CLOSED TREE
Backed out changeset 28a2fba71977 (bug 1510030)
Backed out changeset 1700b3a416cd (bug 1510030)
Backed out changeset 087518046b0c (bug 1510030)
Backed out changeset 6b3af91a7ce6 (bug 1510030)
Backed out changeset 737f4bc3afd3 (bug 1510030)
Backed out changeset 921116ca67a5 (bug 1510030)
2020-02-27 04:45:04 +02:00
Hiroyuki Ikezoe
16884039b4 Bug 1510030 - Implement WebRender backend to run background color animations on the compositor. r=gw,boris
Differential Revision: https://phabricator.services.mozilla.com/D63604

--HG--
extra : moz-landing-system : lando
2020-02-27 02:05:10 +00:00
Hiroyuki Ikezoe
e82e30903f Bug 1510030 - Make prepare_prim_for_render private. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63603

--HG--
extra : moz-landing-system : lando
2020-02-27 02:04:52 +00:00
Hiroyuki Ikezoe
eaecfc15ba Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63601

--HG--
extra : moz-landing-system : lando
2020-02-27 02:04:39 +00:00
Hiroyuki Ikezoe
b63099423f Bug 1510030 - Don't return the current opacity value from update_opacity_binding. r=gw
The return value is not used at all.

Differential Revision: https://phabricator.services.mozilla.com/D63600

--HG--
extra : moz-landing-system : lando
2020-02-27 02:04:21 +00:00
Cosmin Sabou
074eb7c67b Backed out 6 changesets (bug 1510030) for causing build bustages. CLOSED TREE
Backed out changeset 1bf2a082ca62 (bug 1510030)
Backed out changeset 8b0fd12a063b (bug 1510030)
Backed out changeset ec9c6b79ea42 (bug 1510030)
Backed out changeset cd729f8b0220 (bug 1510030)
Backed out changeset c3e6c17ba7b0 (bug 1510030)
Backed out changeset edc3c212be1f (bug 1510030)
2020-02-27 02:50:40 +02:00
Hiroyuki Ikezoe
36b296aee4 Bug 1510030 - Implement WebRender backend to run background color animations on the compositor. r=gw,boris
Differential Revision: https://phabricator.services.mozilla.com/D63604

--HG--
extra : moz-landing-system : lando
2020-02-26 09:51:25 +00:00
Hiroyuki Ikezoe
4dc0f32fb9 Bug 1510030 - Make prepare_prim_for_render private. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63603

--HG--
extra : moz-landing-system : lando
2020-02-26 09:25:43 +00:00
Hiroyuki Ikezoe
2f103360b0 Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63601

--HG--
extra : moz-landing-system : lando
2020-02-26 09:25:31 +00:00
Hiroyuki Ikezoe
1257dfdd43 Bug 1510030 - Don't return the current opacity value from update_opacity_binding. r=gw
The return value is not used at all.

Differential Revision: https://phabricator.services.mozilla.com/D63600

--HG--
extra : moz-landing-system : lando
2020-02-26 09:25:13 +00:00
Glenn Watson
b41469cef3 Bug 1579235 - Part 5 - Support compositor surfaces for draw compositor mode. r=Bert
This patch adds support for YUV images to be promoted to compositor
surfaces when using the simple (draw) compositor mode. A follow up
to this will extend support to native compositor implementations.

We rely on only promoting compositor surfaces that are opaque
primitives. With this assumption, the tile(s) that intersect the
compositor surface get a 'cutout' in the location where the
compositor surface exists, allowing that tile to be drawn as
an overlay after the compositor surface.

Tiles are only drawn in overlay mode if there is content that
exists on top of the compositor surface. Otherwise, we can draw
the tiles in the normal fast path before the compositor surface
is drawn.

The patch also introduces a new subpixel AA mode, which allows
subpixel rendering to be enabled conditionally as long as the
text run does not intersect some number of excluded rectangle
regions. In this way, subpixel text remains on most of the page,
but is disabled for elements that are drawn into transparent
regions of the tile where the compositor surface exists.

This allows video playback to be composited directly into the
framebuffer, without invalidation of content tiles, which can
save a significant amount of battery power and improve performance.

Differential Revision: https://phabricator.services.mozilla.com/D63816

--HG--
extra : moz-landing-system : lando
2020-02-26 20:41:25 +00:00
Andreea Pavel
1f0dedc29d Backed out 2 changesets (bug 1596513) for webrender wrench bustages on a CLOSED TREE
Backed out changeset 49e61b566da1 (bug 1596513)
Backed out changeset 889cee140af8 (bug 1596513)
2020-02-25 09:37:45 +02:00
cbrewster
049a3f19c3 Bug 1596513: Part 1: Take scale factors into account when rendering drop shadows in WebRender r=gfx-reviewers,kvark
Differential Revision: https://phabricator.services.mozilla.com/D63441

--HG--
extra : moz-landing-system : lando
2020-02-25 06:02:59 +00:00
Miko Mynttinen
5a00de3d66 Bug 1616422 - Part 2: Update display item cache state after call to CreateWebRenderCommands() r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63276

--HG--
extra : moz-landing-system : lando
2020-02-25 00:08:19 +00:00
Miko Mynttinen
69f1544841 Bug 1616422 - Part 1: Refactor WR display item caching and add additional checks r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63275

--HG--
extra : moz-landing-system : lando
2020-02-25 00:07:07 +00:00
Daniel Varga
b8dccd6369 Backed out 2 changesets (bug 1616422) for causing webrender-lint-tidy failures
CLOSED TREE

Backed out changeset 3d44ebc7aed0 (bug 1616422)
Backed out changeset d17dbf82cdd0 (bug 1616422)
2020-02-25 01:33:21 +02:00
Miko Mynttinen
2d36bc960e Bug 1616422 - Part 2: Update display item cache state after call to CreateWebRenderCommands() r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63276

--HG--
extra : moz-landing-system : lando
2020-02-24 23:01:12 +00:00
Miko Mynttinen
e8234095c0 Bug 1616422 - Part 1: Refactor WR display item caching and add additional checks r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63275

--HG--
extra : moz-landing-system : lando
2020-02-24 23:00:34 +00:00
Jim Blandy
5ea7b962f8 Bug 1617747: Fix doc comments for LinearGradientKey and RadialGradientKey. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D63965

--HG--
extra : moz-landing-system : lando
2020-02-24 23:02:55 +00:00
Jamie Nicol
a72934e6f3 Bug 1614679 - Cache compiled shaders to disk even after startup. r=jrmuizel
Previously we only saved shaders to disk on the tenth frame, meaning
shaders compiled afterwards would not be cached and would need to be
recompiled in future runs of the application. This change makes it so
that we cache shaders to disk regardless of which frame they are
compiled in.

We continue to treat only the shaders used within the first ten frames
as the "startup shaders", meaning only those ones will be loaded on
next startup. Caching as many other shaders as possible is still
beneficial, however, as they are loaded on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D62748

--HG--
extra : moz-landing-system : lando
2020-02-24 16:38:25 +00:00
Nicolas Silva
6d4a857a53 Bug 1616804 - Update image to 0.23 in WebRender. r=jrmuizel
Original patch by Josh Mattews in https://github.com/servo/webrender/pull/3854

Also run mach vendor rust.

Differential Revision: https://phabricator.services.mozilla.com/D63468

--HG--
extra : moz-landing-system : lando
2020-02-24 15:56:22 +00:00
Andrew Osmond
aca7b9ae9c Bug 1617160 - Fold the raster scale and device pixel scale into font transform. r=lsalzman
This patch folds the raster scale and device pixel scale effects into
the font transform, instead of the font size itself. This helps minimize
the quantization effect given the font size is stored as an Au
(resolution of 1/60) instead of an f32, and the shader does not
replicate that effect.

Differential Revision: https://phabricator.services.mozilla.com/D63641

--HG--
extra : moz-landing-system : lando
2020-02-24 12:18:45 +00:00
Bogdan Tara
3053d61c49 Backed out changeset 8665af6e62a6 (bug 1600793) on jcristau's request CLOSED TREE 2020-02-24 15:49:47 +02:00
Glenn Watson
6428cbe4fc Bug 1579235 - Part 4 - Refactor more parts of brush yuv shader. r=nical
Move the UV writing function into the shared yuv.glsl include so
that the YUV compositing shader will be able to access it.

Differential Revision: https://phabricator.services.mozilla.com/D63815

--HG--
extra : moz-landing-system : lando
2020-02-24 09:10:32 +00:00