Commit Graph

585 Commits

Author SHA1 Message Date
Barret Rennie
b161b2b08f Bug 1551735 - Add a mode to the AsyncScreenshotGrabber to enable composition recording r=kvark
The AsyncScreenshotGrabber now can operate in two modes:

* `ProfilerScreenshots`, which does asynchronous scaling of the captured frames
  for inclusion in profiles by the Gecko Profiler; and
* `CompositionRecorder`, which does not do any scaling and is used for visual
  metrics computations.

The latter mode is exposed by on the `Renderer` via the `record_frame`,
`map_recorded_frame`, and `release_composition_recorder_structures` methods.

A different handle type (`RecordedFrameHandle`) is returned and consumed by
these functions, but they translate between `RecordedFrameHandle` and
`AsyncScreenshotHandle` when communicating with the underlying
`AsyncScreenshotGrabber`.

I considered making the `AsyncScreenshotGrabber` generic over its handle type,
but the extra cost of monomorphization just to change the handle type did not
seem worth it.

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

--HG--
extra : moz-landing-system : lando
2019-05-29 21:52:44 +00:00
Barret Rennie
4ca216e100 Bug 1551735 - Split out screenshot grabbing infrasturcture into a new module r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D32523

--HG--
extra : moz-landing-system : lando
2019-05-29 21:52:25 +00:00
Noemi Erli
1927c42ef1 Backed out changeset cb8c60790fd9 (bug 1536240) for causing build bustages CLOSED TREE 2019-05-30 21:55:29 +03:00
Connor Brewster
6dd4341bb0 Bug 1536240 - Add debug option to wrench to output specified shader source r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D33088

--HG--
extra : moz-landing-system : lando
2019-05-30 16:18:42 +00:00
Connor Brewster
bb54c17ce3 Bug 1555476 - Implement flood filter in WebRender r=gw
Differential Revision: https://phabricator.services.mozilla.com/D33109

--HG--
extra : moz-landing-system : lando
2019-05-30 03:11:53 +00:00
Dzmitry Malyshau
b431e7fe94 Bug 1554502 - Configurable lookback count r=gw
We've had a constant of 10 hard-coded there since early days.
Turning it into a configurable number allows us to easier tune it and
debug related issues.

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

--HG--
extra : moz-landing-system : lando
2019-05-30 01:29:43 +00:00
Dzmitry Malyshau
d5d646901c Bug 1532174 - WR remove the world transformations from SpatialNode r=gw
This is the last big step towards consistent flattening of transformations.
It includes removing the old "project_to_2d" method from the utils.

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

--HG--
extra : moz-landing-system : lando
2019-05-27 03:35:24 +00:00
Bastien Orivel
7294fc12b5 Bug 1554426 - Re-introduce Renderer::current_epoch. r=emilio
It was removed in 1441308 but is used by servo

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

--HG--
extra : moz-landing-system : lando
2019-05-25 23:02:40 +00:00
Bastien Orivel
998c4ce860 Bug 1554401 - Part 1: Update dwrote to 0.9. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D32567

--HG--
extra : moz-landing-system : lando
2019-05-25 17:08:40 +00:00
Lee Salzman
b1e52e6aaf Bug 1553910 - pass DWrite subpixel order into Skia and WebRender. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D32545

--HG--
extra : moz-landing-system : lando
2019-05-25 16:20:59 +00:00
Glenn Watson
8d73dca1e7 Bug 1553701 - Remove the clip chain stack during the prepare_prims pass in WR. r=kvark,nical
During the visibility pass, the main clip chain instance for each
primitive is created. In the prim prepare pass, a clip chain instance
is generated for each segment (of primitives that are segmented).

This previously required maintaining the active clip chain stack
during both passes. However, this is not ideal for a number of
reasons: the code is somewhat complicated / error prone and the
segment clip chain building step does more work than required.

This patch changes the segment clip chain building code to set up
the active clip nodes based on the result of the initial clip
chain built for the overall primitive during the visibility pass.

This means that it's no longer necessary to maintain the active
clip chain stack during the prepare pass. This simplifies some
upcoming picture caching changes related to avoiding redundant
cache invalidations, which is the main motivation for the change.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 03:09:28 +00:00
Dzmitry Malyshau
bb778aa169 Bug 1551520 - Use WR relative transform instead of the world inverse r=gw
This is a follow-up to https://phabricator.services.mozilla.com/D30600

Previously, I changed changed the space mapper logic to use the world transformations.
This was seemingly needed because we requrested the relation between primitives and
their clip nodes, which could be in unrelated spatial sub-trees.
However, I believe the change was a mistake, since for clips we should not even try
to get the relative mapping, and clipping is done in world space for these cases.
This change reverts that logic back. ~~Fingers crossed for the try to not show any
asserts firing up inside get_relative_transform.~~ Try is green 🎉

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

--HG--
extra : moz-landing-system : lando
2019-05-24 00:22:17 +00:00
Dzmitry Malyshau
a176290c0a Bug 1532174 - WR cache world transform on coordinate systems r=gw
Differential Revision: https://phabricator.services.mozilla.com/D32195

--HG--
extra : moz-landing-system : lando
2019-05-22 19:58:39 +00:00
Jamie Nicol
94cf690698 Bug 1531142 - Avoid excessive glyph rasterization when pinch zooming. r=gw,kats
When pinch zooming webrender would re-rasterize glyphs for each tiny
difference in zoom level. This takes time in itself, but also causes
the texture cache to grow incredibly large, to the point where
resizing it to make room for more glyphs takes far too much time.

This patch avoids this by rounding the size at which glyphs are
rasterized whilst pinch zooming. To do this we add a FrameMsg which
APZ uses to tell webrender whether a spatial node is being pinch
zoomed. Then during frame building if a spatial node is being pinch
zoomed we override the raster space of its corresponding picture.

The chosen raster space is the current zoom level rounded up to the
nearest power of two, but not exceeding 8x. This seems to be a good
balance between quality and performance, though at high zoom levels
the cache still does grow very large due to the size of the glyphs.

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

--HG--
extra : moz-landing-system : lando
2019-05-22 20:13:34 +00:00
Glenn Watson
0f8cee5dd5 Bug 1552984 - Refactor parts of the WR batching and flattening code, to support future picture caching improvements. r=kvark
This patch contains two isolated changes related to upcoming picture
caching improvements. Specifically:

 * Determine the blit reason for stacking contexts with clips
   earlier, during scene building. This simplifies the code and
   allows better detection of redundant stacking contexts.
 * Centralize the code for pushing batch instances into a small
   number of places. This will simplify the switch to adding
   a single primitive to multiple batch lists, in the case of
   dirty regions with different batchers.

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

--HG--
extra : moz-landing-system : lando
2019-05-22 14:57:10 +00:00
Bastien Orivel
cf92185937 Bug 1550903 - Part 1: Update ws to 0.8. r=emilio
This is part of the effort to get all the other versions of rand out.
Unfortunately the diff is kinda bug because this is the first crate
requiring rand 0.6 which has been split into multiple crates.

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

--HG--
extra : moz-landing-system : lando
2019-05-18 21:30:23 +00:00
shindli
caf77278c5 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-05-17 19:38:09 +03:00
arthur.iakab
93aedcdbe3 Backed out 2 changesets (bug 1550903) for causing multiple build bustages CLOSED TREE
Backed out changeset d62be51ffad3 (bug 1550903)
Backed out changeset f48939dc27b6 (bug 1550903)

--HG--
rename : third_party/rust/rand-0.4.3/appveyor.yml => third_party/rust/rand/appveyor.yml
rename : third_party/rust/rand-0.4.3/benches/bench.rs => third_party/rust/rand/benches/bench.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/exponential.rs => third_party/rust/rand/benches/distributions/exponential.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/gamma.rs => third_party/rust/rand/benches/distributions/gamma.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/mod.rs => third_party/rust/rand/benches/distributions/mod.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/normal.rs => third_party/rust/rand/benches/distributions/normal.rs
rename : third_party/rust/rand-0.4.3/src/distributions/range.rs => third_party/rust/rand/src/distributions/range.rs
rename : third_party/rust/rand_jitter/src/lib.rs => third_party/rust/rand/src/jitter.rs
rename : third_party/rust/rand-0.4.3/src/os.rs => third_party/rust/rand/src/os.rs
rename : third_party/rust/rand-0.4.3/src/prng/chacha.rs => third_party/rust/rand/src/prng/chacha.rs
rename : third_party/rust/rand-0.4.3/src/prng/isaac.rs => third_party/rust/rand/src/prng/isaac.rs
rename : third_party/rust/rand-0.4.3/src/prng/isaac64.rs => third_party/rust/rand/src/prng/isaac64.rs
rename : third_party/rust/rand-0.4.3/src/prng/xorshift.rs => third_party/rust/rand/src/prng/xorshift.rs
rename : third_party/rust/rand-0.4.3/src/rand_impls.rs => third_party/rust/rand/src/rand_impls.rs
rename : third_party/rust/rand-0.4.3/src/read.rs => third_party/rust/rand/src/read.rs
rename : third_party/rust/rand-0.4.3/src/reseeding.rs => third_party/rust/rand/src/reseeding.rs
rename : third_party/rust/rand-0.4.3/src/seq.rs => third_party/rust/rand/src/seq.rs
rename : third_party/rust/rand-0.4.3/utils/ziggurat_tables.py => third_party/rust/rand/utils/ziggurat_tables.py
rename : third_party/rust/fuchsia-cprng/LICENSE => third_party/rust/sha1/LICENSE
2019-05-17 03:24:33 +03:00
Bastien Orivel
f75d160ef4 Bug 1550903 - Part 1: Update ws to 0.8. r=emilio
This is part of the effort to get all the other versions of rand out.
Unfortunately the diff is kinda bug because this is the first crate
requiring rand 0.6 which has been split into multiple crates.

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

--HG--
extra : moz-landing-system : lando
2019-05-15 17:38:14 +00:00
Glenn Watson
7690d772ae Bug 1552084 - Remove lifetime requirements on DrawTarget and ReadTarget in WR. r=emilio
This makes DrawTarget and ReadTarget no longer require a borrow
on a texture. This was previously fine, but in the near future
WR will be rendering picture caching surfaces directly into
texture handles. To allow this, we need to remove the borrow check
requirement on DrawTarget for rustc.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 22:25:35 +00:00
Nicolas Silva
cc8b7cf247 Bug 1551187 - Rename DropShadowStack into DropShadows. r=kvark"
Differential Revision: https://phabricator.services.mozilla.com/D31248

--HG--
extra : source : fec43bfabf433e3df38114cc172c43d3d9e805d6
2019-05-15 15:21:53 +02:00
Nicolas Silva
f32fc5556b Bug 1551187 - Box the color matrix in Filter. r=kvark
ColorMatrix is rarely used but takes most space in the Filter enum.
This removes 44 bytes from the enum and all structs that embed it.

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

--HG--
extra : source : 07bf88839e1c35e678d11790e149dfda7f00cf30
extra : intermediate-source : bf2c0752c25f339a1179377dbb312249426609de
2019-05-13 14:55:57 +02:00
Nicolas Silva
69467ad736 Bug 1551187 - Rename render task tree into render task graph. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D30897

--HG--
extra : source : fd6cd1ec027cbba9318ff95707442720bfab4869
extra : intermediate-source : 4a7bd2c049d36a507fc0ecbfc5507c2738db050e
2019-05-15 15:11:42 +02:00
Nicolas Silva
1605b8d73b Bug 1551187 - Remove the single-shadow picture composite code. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D30896

--HG--
extra : source : 65211647408f5d152868e25dff853ad6692d35a8
extra : intermediate-source : a14155473c5d593ebdfbce7ad5ca3521392ea6ba
2019-05-15 15:57:34 +02:00
Jamie Nicol
318728e2ed Bug 1550582 - Ensure the overlap is filled correctly when opposite border edges overlap. r=gw
To fix bug 1496540 it was made so that webrender clips border corner
segments so that they do not overlap with their opposing
edges. However, cases where opposing _edges_ both overlap with
eachother (rather than just a corner overlapping with an edge), the
corners are clipped too far and a gap is left in the middle.

Additionally, no clipping was added to the edge segments. So rather
than there be a gap there is an area that is painted twice, which is
apparent if the colour is semi-transparent.

This fixes these issues by identifying when opposing edges overlap and
calculating the midpoint, then clipping the edges and corners to that
midpoint instead.

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

--HG--
extra : moz-landing-system : lando
2019-05-15 10:43:25 +00:00
Barret Rennie
1a5e406183 Bug 1551353 - Correctly map PBOs for readback on GLES r=kvark
The implementation of `Device::map_pbo_for_readback` on GLES (e.g., Windows
with ANGLE) was using the incorrect enumeration value when attempting to map
the buffer into memory.

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

--HG--
extra : moz-landing-system : lando
2019-05-14 22:54:19 +00:00
Glenn Watson
5108fcd99f Bug 1551131 - Refactor WR batching code in preparation for different batches per dirty region / render task. r=nical
* Store render task address per-instance rather than per-primitive, to allow adding a single primitive to multiple batches / render tasks.
* Store render task id inside alpha batch builder, since multiple batch builders will be passed in future.
* Add primitive visibility mask, storing a bit mask of which dirty regions a visible primitive intersects.
* Store RenderTaskAddress as a u16 in CPU and shader types.
* Add picture caching debug flag to wrench.

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

--HG--
extra : moz-landing-system : lando
2019-05-14 07:17:24 +00:00
Cosmin Sabou
530b9c7e9c Backed out 2 changesets (bug 1550903) for webrender bustages. a=backout
Backed out changeset fe8d48740511 (bug 1550903)
Backed out changeset cc187a665ccf (bug 1550903)

--HG--
rename : third_party/rust/rand-0.4.3/appveyor.yml => third_party/rust/rand/appveyor.yml
rename : third_party/rust/rand-0.4.3/benches/bench.rs => third_party/rust/rand/benches/bench.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/exponential.rs => third_party/rust/rand/benches/distributions/exponential.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/gamma.rs => third_party/rust/rand/benches/distributions/gamma.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/mod.rs => third_party/rust/rand/benches/distributions/mod.rs
rename : third_party/rust/rand-0.4.3/benches/distributions/normal.rs => third_party/rust/rand/benches/distributions/normal.rs
rename : third_party/rust/rand-0.4.3/src/distributions/range.rs => third_party/rust/rand/src/distributions/range.rs
rename : third_party/rust/rand_jitter/src/lib.rs => third_party/rust/rand/src/jitter.rs
rename : third_party/rust/rand-0.4.3/src/os.rs => third_party/rust/rand/src/os.rs
rename : third_party/rust/rand-0.4.3/src/prng/chacha.rs => third_party/rust/rand/src/prng/chacha.rs
rename : third_party/rust/rand-0.4.3/src/prng/isaac.rs => third_party/rust/rand/src/prng/isaac.rs
rename : third_party/rust/rand-0.4.3/src/prng/isaac64.rs => third_party/rust/rand/src/prng/isaac64.rs
rename : third_party/rust/rand-0.4.3/src/prng/xorshift.rs => third_party/rust/rand/src/prng/xorshift.rs
rename : third_party/rust/rand-0.4.3/src/rand_impls.rs => third_party/rust/rand/src/rand_impls.rs
rename : third_party/rust/rand-0.4.3/src/read.rs => third_party/rust/rand/src/read.rs
rename : third_party/rust/rand-0.4.3/src/reseeding.rs => third_party/rust/rand/src/reseeding.rs
rename : third_party/rust/rand-0.4.3/src/seq.rs => third_party/rust/rand/src/seq.rs
rename : third_party/rust/rand-0.4.3/utils/ziggurat_tables.py => third_party/rust/rand/utils/ziggurat_tables.py
rename : third_party/rust/fuchsia-cprng/LICENSE => third_party/rust/sha1/LICENSE
2019-05-14 08:16:26 +03:00
Bastien Orivel
4816d6ec16 Bug 1550903 - Part 1: Update ws to 0.8. r=emilio
This is part of the effort to get all the other versions of rand out.
Unfortunately the diff is kinda bug because this is the first crate
requiring rand 0.6 which has been split into multiple crates.

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

--HG--
extra : moz-landing-system : lando
2019-05-12 12:38:56 +00:00
Nicolas Silva
ea0c5eda0a Bug 1536021 - Sanitize filters in place. r=kvark
--HG--
extra : source : d68b728d584c38053387c4df0096a9744389469f
extra : intermediate-source : 4e52aa850e3607ffe872a8da66874eaddefea046
2019-05-10 01:23:54 +02:00
Nicolas Silva
c7a54e68a1 Bug 1536021 - Shadow stack implementation. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D30620

--HG--
extra : source : e830b256419b53556e27aa2586f2ed8f715aa99e
extra : intermediate-source : c223987f3de744979a0b08b336b46ac9f199e9bd
2019-05-12 12:27:44 +02:00
Daniel Varga
84647fc525 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2019-05-11 00:53:46 +03:00
Andrew Osmond
11a7bb40e7 Bug 1550725 - Cull primitives with an empty clip. r=kvark
When the clip chain generates the local clip rect for a primitive, it
can be empty. This violated the assumption that the visible rect will
never be empty, and so when we snap, it produces NaNs, which in turn,
violates other assumptions when converting between spaces, and hence the
crash.

Now we cull the primitive from the visible list if the local clip rect
is empty, or if the visible rect is empty.

Differential Revision: https://phabricator.services.mozilla.com/D30659
2019-05-10 16:31:13 -04:00
Dzmitry Malyshau
7f9b0ee390 Bug 1532174 - Repace WR RelativeTransform with CoordinateSpaceMapping, improve flattening semantics. r=gw
This change makes get_relative_transform() to no longer rely on any flattening done before in the pipeline.
This makes it correct is some of the cases we failed previously (see ini files removed).
It now does flattening on every flat coordinate system it passes through, and it's used for SpaceMapper.
The old RelativeTransform is now replaced with CoordinateSpaceMapping, which reduces the zoo of our types :)

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

--HG--
extra : moz-landing-system : lando
2019-05-10 02:22:51 +00:00
Glenn Watson
4d09f84fb5 Bug 1524427 - Fix panic when clip mask is supplied with non-existent image key. r=kvark
In some cases, Gecko supplies a display item with an image clip
mask where the image itself does not exist in the resource cache.

In these cases, WR would skip requesting the image, but would
still try to fetch the image info during batching, causing a panic.

This patch skips adding clip items to the batching pass if the
image mask does not exist.

It also adds support to wrench for a crash test when the image
mask is invalid.

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

--HG--
extra : moz-landing-system : lando
2019-05-09 21:23:58 +00:00
Glenn Watson
cbb89e0d8a Bug 1549921 - Refactor batch building code in preparation for multiple alpha batchers per picture. r=kvark
This patch is scaffolding only - there shouldn't be any functional
changes as a result of these changes.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 20:32:39 +00:00
Csoregi Natalia
0b4a204c24 Merge mozilla-central to autoland. CLOSED TREE 2019-05-08 06:39:09 +03:00
Csoregi Natalia
197210b8c1 Merge inbound to mozilla-central. a=merge 2019-05-08 06:37:15 +03:00
Dzmitry Malyshau
0ab96c1983 Bug 1532174 - Refactor WR fast transform, use when returning relative transforms r=gw
Based on https://phabricator.services.mozilla.com/D30229

Instead of converting from the scale-offset to the transform right away in
`get_relative_transform`, we only do it if there is a jump between coordinate spaces.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 02:32:15 +00:00
Nicolas Silva
987eae6cae Bug 1543974 - Add render task scheduling tests. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D30021

--HG--
extra : source : 41300ab303ce3fe31a5065cd899949aa4fc97f95
2019-05-07 17:25:27 +02:00
Glenn Watson
effaccc4f6 Bug 1549271 - Create render task graph earlier during frame building. r=nical
This moves creation of the render task graph to be slightly
earlier during frame building. Instead of creeating the render
tasks during prepare_prims, they are created during the
take_context call for pictures, before recursing into primitives.

This means that in future we can have a surface that targets
multiple render tasks (e.g. for multiple dirty regions), which
may create a different batch set for each region.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 20:49:56 +00:00
Lee Salzman
0037d62d7b Bug 1414961 - enable WR dual-source blending by default. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D30107

--HG--
extra : moz-landing-system : lando
2019-05-07 02:30:16 +00:00
Alexis Beingessner
63afa58e9a Bug 1525402 - Mark all gfx/wr crates as Rust 2018. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D29569

--HG--
extra : moz-landing-system : lando
2019-05-07 01:39:22 +00:00
Alexis Beingessner
9847a632f7 Bug 1525402 - Run cargo fix --edition on webrender on macos. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D29567

--HG--
extra : moz-landing-system : lando
2019-05-07 01:40:23 +00:00
Alexis Beingessner
89682a3ff0 Bug 1525402 - Manual fixups for configs cargo fix missed. r=kvark
cargo fix works by building under a specific config, so we can't hit both
sides of a mutually exclusive pair of cfgs, such as cfg(target_os) or
when cfg(feature) and cfg(not(feature)) both exist in the codebase.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 01:40:21 +00:00
Alexis Beingessner
3c003ecb1c Bug 1525402 - Migrate webrender externs to a Rust 2018 compatible form. r=kvark
Notably `extern crate foo as bar` is no longer supported
(must do it in Cargo.toml). Also stopped using euclid through webrender_api,
because it produces worse results in 2018.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 01:40:19 +00:00
Oana Pop Rus
65399363fb Merge inbound to mozilla-central. a=merge 2019-05-07 00:45:24 +03:00
Doug Thayer
8efbd9be96 Bug 1541078 - Add pre/post frames hooks into save_capture r=kvark
There's two ways we could get around this. We could add a path
around the prepared_for_frames assertion in GpuCache::end_frame,
or we can do this, and leave the TODO explicit with the
assertion. I took the latter approach because we can clear
the GpuCache / TextureCache through other routes than frame
building anyway, so we could hit this failure path before
any of the patches in this bug landed.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 17:21:22 +00:00
Doug Thayer
2f3c20a88f Bug 1541078 - Rename before/after_frames r=kvark
These aren't great names - I couldn't come up with better though.
We lose the symmetry of before/after but this clarifies a little
bit what they are doing.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 17:21:10 +00:00
Doug Thayer
c3b4dee3c1 Bug 1541078 - Require frame builds for all docs after GpuCache clear r=kvark
If we run a GpuCache clear and do not update all documents, we run into
situations where the stale documents try to access things in the gpu
cache and just show random garbage. The solution is similar to what we
do for TextureCache, so I am just duplicating those signatures and providing
helpers in RenderBackend to access both together.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 17:21:01 +00:00
Nicolas Silva
284bf80f3f Bug 1543974 - Deal with conflicting render task rect scheduling and allocation. r=kvark
Due to the render task ping-pong target allocation scheme, we need to ensure:
 - that tasks only read from tasks that are an odd number of passes apart,
 - that render task content is kept valid long enough for all of the dependent tasks.

The former is solved in this patch through blit tasks, the latter by marking tasks for saving as needed.

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

--HG--
extra : moz-landing-system : lando
2019-05-04 13:31:13 +00:00
Doug Thayer
9dddfa57d6 Bug 1538540 - Respect texture_cache rebuild reqs even if doc has no pixels r=kvark
If a document has an empty rect for whatever reason (in the case observed, this was
due to running a full screen video in the content document, which occludes the
chrome document), then we still want to ensure that we build a frame if the
texture cache has performed a clear, as otherwise we may try to access stale
items from the texture resolver in render_impl.

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

--HG--
extra : moz-landing-system : lando
2019-05-03 20:30:46 +00:00
Glenn Watson
44849e69c1 Bug 1548712 - Restructure and tidy up some code in prepare primitive pass. r=kvark,nical
Differential Revision: https://phabricator.services.mozilla.com/D29777

--HG--
extra : moz-landing-system : lando
2019-05-03 20:26:32 +00:00
Kartikaya Gupta
82055a726b Bug 1547833 - Check for the KHR_debug extension before trying to use it. r=gw,kvark
Differential Revision: https://phabricator.services.mozilla.com/D29824

--HG--
extra : moz-landing-system : lando
2019-05-06 12:16:15 +00:00
Mihai Alexandru Michis
359ca2cfd0 Backed out changeset 8f066e5c42c8 (bug 1543974) for causing bustages on webrender builds CLOSED TREE 2019-05-07 11:38:28 +03:00
Nicolas Silva
6b44beb855 Bug 1543974 - Add render task scheduling tests. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D30021

--HG--
extra : moz-landing-system : lando
2019-05-07 03:03:16 +00:00
Andrew Osmond
5b1c558e2a Bug 1540200 - Part 3. Reuse snapping offsets calculated on the CPU in the WebRender shaders. r=kvark
Historically we calculated the snapping offsets in the GPU shaders.
Because this information is always needed on the CPU side, we now just
pass the values into the shader instead of recalculating again. This
ensures we will use the same set of values consistently and makes it
easier to adjust how we snap in the future.

This patch should have no functional change on the output of WebRender
itself.

Differential Revision: https://phabricator.services.mozilla.com/D28883
2019-05-06 08:36:50 -04:00
Andrew Osmond
28d348f0dc Bug 1540200 - Part 2. Calculate snapped primitive rect and offsets for WebRender on the CPU. r=kvark
We currently do most snapping on the GPU in the shader. However the
picture's local rect needs to take into account the snapping done there,
so we need to calculate this earlier in the pipeline. Instead of using
the clipped primitive local rects to create the picture's own local
rect, we now snap the child local rects first. If no snapping is
required, there should be no functional change. If snapping is required,
there should be fewer visual distortions caused by an inaccurate picture
local rect.

Differential Revision: https://phabricator.services.mozilla.com/D28882
2019-05-06 08:36:50 -04:00
Andrew Osmond
1a022002f5 Bug 1540200 - Part 1. Move picture local rect calculation to update visibility. r=kvark
We currently calculate a picture's local rect when we are doing the
first picture traversal. It was composed of the union of the clipped
local rects of its children. However the true local rect of a picture is
the union of the snapped clipped local rects of its children. The
snapping is done in device space, but we won't know the exact transform
until we establish the raster roots, which is based on the picture's
local rect.

As such, we create an estimated local rect which is how we currently
calculate the local rect. Then once the raster roots have been selected,
we recalculate the local rect of the picture based on its children
during update visibility.

This patch should have not contain any functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D28881
2019-05-06 08:36:50 -04:00
Glenn Watson
51efa36789 Bug 1548405 - Do all resource requests during visibility pass in WR. r=kvark
This builds on earlier patches to move all remaining resource requests
to occur during the visibility pass, and change the block on glyph
rasterization to occur after the visibility pass.

This allows batch generation to occur during the prepare_prims pass,
which is useful for generating a batch set per-dirty-region, while
only doing a single pass of the picture / primitive tree.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 01:54:32 +00:00
Dzmitry Malyshau
9512939607 Bug 1548131 - WR reset texture allocation r=gw
Introduce a new texture allocation operation "reset", which acts like a "realloc" but without the contents preserved.
Use it for the picture texture cache.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 22:43:16 +00:00
Doug Thayer
512461990a Bug 1538540 - Sanity check frames after TextureCache clears r=bholley
In trying to diagnose bug 1538540, I'm hitting my limits as far as
simply staring at the code and trying to work out possible ways to
hit the crash goes. This assertion will split the search space into
clear-related causes and non-clear-related causes to narrow things
down.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 01:37:02 +00:00
Dzmitry Malyshau
0302456bb8 Bug 1525420 - Use KHR_blend_equation_advanced for mix-blend mode implementation r=gw
Use natively supported mix-blend modes, where appropriate. Disabled by default.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 20:45:22 +00:00
Glenn Watson
546a095298 Bug 1548202 - Request glyphs earlier during frame building. r=kvark
This patch changes glyph requests in the resource cache to occur
as soon as a text run is found to be visible, rather than during
the prepare_prims pass.

This has two major benefits:
 - (with other patches) will allow some batching code to run
   during the prepare_prims pass.
 - allows glyph raster worker threads to start earlier in the
   frame, which may lead to less time blocking on the workers.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 20:35:18 +00:00
Glenn Watson
21c39a0ede Bug 1548171 - Allocate texture cache location for render task cache immediately. r=kvark
This is a first step towards allowing (some) batching work to be
done during prepare_prims pass rather than render pass building.

This is prep work related to output different batch lists for a given
picture (e.g. a different batch list per dirty region), rather than
replaying the same batch list.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 20:31:47 +00:00
Andreea Pavel
4fea4aeb28 Merge mozilla-central to autoland. on a CLOSED TREE 2019-05-01 19:05:19 +03:00
Nicolas Silva
798d69cc03 Bug 1533735 - Refactor render task pass assignment in preparation for the render graph work. r=gw,kvark
In addition, batch together render tasks for the cached render tasks.

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

--HG--
extra : source : 1b80e184b0bd6324ea62d1e38b2061da2b96a867
2019-04-29 17:53:00 +02:00
Kartikaya Gupta
e8dfcba2e3 Bug 1548197 - Remove unused mut instances to fix warnings with rust nightly. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D29492

--HG--
extra : moz-landing-system : lando
2019-05-01 13:54:09 +00:00
Ciure Andrei
b54e31abf8 Backed out changeset 91859883a54d (bug 1538540) for causing tests crashes with [@ GeckoCrash] CLOSED TREE 2019-05-01 12:46:56 +03:00
Doug Thayer
92c9cb3613 Bug 1538540 - Sanity check frames after TextureCache clears r=bholley
In trying to diagnose bug 1538540, I'm hitting my limits as far as
simply staring at the code and trying to work out possible ways to
hit the crash goes. This assertion will split the search space into
clear-related causes and non-clear-related causes to narrow things
down.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 23:58:23 +00:00
Kartikaya Gupta
140fb1c366 Bug 1547097 - Remove ReadPixelsFormat. r=kvark
The Rgba8 enum value is redundant with the Standard(ImageFormat::RGBA8) value,
this patch collapses the former into the latter. Which then makes the entire
ReadPixelsFormat redundant, so we can get rid of it completely.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 17:43:41 +00:00
Nicolas Silva
c55d3f681a Bug 1547290 - Mark CaptureConfig::file_path allow(dead_code) on a CLOSED TREE. r=me
--HG--
extra : histedit_source : 9188555b2ccaeb30a135ed4aecfb28b01cfd478f
2019-04-30 09:39:15 +02:00
Nicolas Silva
9008946909 Bug 1547290 - Dump the render graph in SVG format in frame captures. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D29005

--HG--
extra : source : b4afebeb22461c276463a919880efdbe0126695d
2019-04-29 16:11:12 +02:00
Glenn Watson
3ba7bef4b0 Bug 1547632 - Remove unused local clip rect stored on WR picture primitives. r=emilio,kvark
Differential Revision: https://phabricator.services.mozilla.com/D29148

--HG--
extra : moz-landing-system : lando
2019-04-29 16:16:11 +00:00
Dzmitry Malyshau
3aa374797c Bug 1525641 - Revise WR backface visibility semantics, separate picture and primitive logic r=gw
This changes our backface visibility semantics to a slightly more complex rule,
as described by Matt (and reinterpret by me in the context of WR) in bug 1525641 during our work week.
We are now propagating is_backface_visible to pictures and evaluate it in the context of
the local transform for a picture if it's outside of preserve-3d context.
We also refactor get_relative_transform() a bit.

Note: this fixes all of the existing backface-visibility bugs: 1525641, 1546110, 1546818
It also passes the Wrench tests, but the try push is still pending for surprises.

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

--HG--
rename : gfx/wr/wrench/reftests/backface/backface-leaf.yaml => gfx/wr/wrench/reftests/backface/backface-3d-leaf.yaml
extra : moz-landing-system : lando
2019-04-29 16:45:38 +00:00
Nicolas Silva
8471eabd7f Bug 1546126 - Fix the max blob tile limit logic. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D28991

--HG--
extra : moz-landing-system : lando
2019-04-26 15:38:54 +00:00
Kartikaya Gupta
336a506446 Bug 1542826 - Add more debug flags to disable various things. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D28356

--HG--
extra : moz-landing-system : lando
2019-04-25 19:29:15 +00:00
Kartikaya Gupta
288d1e8e3e Bug 1542826 - Allow enabling/disabling the debug server at runtime. r=gw
This adds a RendererOption flag to control whether the debug server is
enabled. This allows the debug server feature to be built without
enabling the feature by default; it can then be enabled on a
per-renderer basis via the RendererOption.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 19:28:32 +00:00
Kartikaya Gupta
9fc3672251 Bug 1542826 - Reduce featureset enabled on image crate. r=gw
The debugger in WebRender uses the image crate to generate PNGs, and so
it only really needs the png codec feature from the image crate.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 19:28:23 +00:00
Dzmitry Malyshau
681ee8a0d0 Bug 1546371 - Switch render backend and API away from FramebufferPixel r=gw
The gist of the problem I introduced with the framebuffer coordinate system is that we provided the window rect (effectively) twice:
  1. when computing the document rectangle (and Y-inverting it)
  2. when rendering

If between these points the window got resized (during scene building), we end up with our document aligned to bottom left corner.
The user expects content to still be aligned to the top left, so that's what is visible as a bug.

The change here switched scene building to only care about device coordinate space, restraining the framebuffer coordinates to be mostly
an implementation detail of the renderer/device (the way it was originally meant to be, when introduced). This way the current window size
is only considered once during rendering.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 13:02:47 +00:00
Lee Salzman
e7d7a7b122 Bug 1414961 - check for EXT_blend_func_extended when using GL ES. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D28569

--HG--
extra : moz-landing-system : lando
2019-04-24 05:15:04 +00:00
Razvan Maries
5f610a07b3 Backed out 8 changesets (bug 1542826) for build bustages. CLOSED TREE
Backed out changeset f3516e1416f0 (bug 1542826)
Backed out changeset 1dba743761b7 (bug 1542826)
Backed out changeset a02e469be7b3 (bug 1542826)
Backed out changeset 5118d628ec89 (bug 1542826)
Backed out changeset 5744891efeef (bug 1542826)
Backed out changeset e5af8cd01080 (bug 1542826)
Backed out changeset 314f9bc7dafe (bug 1542826)
Backed out changeset 7df230ea5122 (bug 1542826)
2019-04-23 23:14:06 +03:00
Kartikaya Gupta
d3c9a80c63 Bug 1542826 - Add more debug flags to disable various things. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D28356

--HG--
extra : moz-landing-system : lando
2019-04-23 19:56:23 +00:00
Kartikaya Gupta
6227460f41 Bug 1542826 - Allow enabling/disabling the debug server at runtime. r=gw
This adds a RendererOption flag to control whether the debug server is
enabled. This allows the debug server feature to be built without
enabling the feature by default; it can then be enabled on a
per-renderer basis via the RendererOption.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 19:55:11 +00:00
Kartikaya Gupta
343a8913bf Bug 1542826 - Reduce featureset enabled on image crate. r=gw
The debugger in WebRender uses the image crate to generate PNGs, and so
it only really needs the png codec feature from the image crate.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 19:55:06 +00:00
Alexis Beingessner
8289701d8c Bug 1536121 - rearchitect the webrender display-list. r=gw
disclaimer: this isn't an *amazing* cleanup, but more of a major step that
unlocks the ability to do more minor cleanups and refinements. There's some
messy things and inconsistencies here and there, but we can hopefully iron
them out over time.

1. The primary change here is to move from
    struct { common_fields, enum(specific_fields) }
to
    enum (maybe_common_fields, specific_fields)

most notably this drops the common fields from a ton of things
that don't need them PopXXX, SetXXX, ClipChain, etc.

2. Additionally some types have had some redundant states shaved off,
for instance, rect no longer has *both* bounds and a clip_rect, as
the intersection of the two can be used. This was done a bit conservatively
as some adjustments will need to be done to the backend to fully eliminate
some states, and this can be done more incrementally.

2.5. As a minor side-effect of 2, we now early-reject some primitives whose
bounds and clip_rect are disjoint.

3. A HitTest display item has been added, which is just a Rect without
color. In addition to the minor space wins from this, this makes it much
easier to debug display lists

4. Adds a bunch of comments to the display list, making it easier to understand
things.

The end result of all these changes is a significantly smaller and easier to
understand display list. Especially on pages like gmail which have so many
clip chains. However this ultimately just makes text an even greater percentage
of pages (often 70-80%).

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

--HG--
extra : moz-landing-system : lando
2019-04-23 17:29:58 +00:00
Alexis Beingessner
bd5e102438 Bug 1536121 - cleanup display list code a little bit to prep for refactor. r=gw
* make all enums repr(u8) (compiler bug blocking this long fixed)
* add display list stats feature
* remove cache markers (abandoned design)
* don't always push empty SetFilters before PushStackingContext
* remove dead pub methods

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

--HG--
extra : moz-landing-system : lando
2019-04-23 17:29:38 +00:00
Glenn Watson
aad259b402 Bug 1546286 - Fix external scroll offset handling for perspective elements. r=emilio
External scroll offsets are not propagated across reference frames.

When a perspective element scrolls relative to an ancestor scroll
frame, remove the effect of any external scroll offset during that
offset calculation.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 09:25:39 +00:00
Dorel Luca
0caaab0f1e Backed out 2 changesets (bug 1536121) for Reftest failures
Backed out changeset 0fc395a2ac71 (bug 1536121)
Backed out changeset 430032511561 (bug 1536121)

--HG--
extra : rebase_source : 95c710b24ec5b76da20ddb5573036c8c73873e9e
2019-04-23 10:05:14 +03:00
Alexis Beingessner
ee4e394f45 Bug 1536121 - rearchitect the webrender display-list. r=gw
disclaimer: this isn't an *amazing* cleanup, but more of a major step that
unlocks the ability to do more minor cleanups and refinements. There's some
messy things and inconsistencies here and there, but we can hopefully iron
them out over time.

1. The primary change here is to move from
    struct { common_fields, enum(specific_fields) }
to
    enum (maybe_common_fields, specific_fields)

most notably this drops the common fields from a ton of things
that don't need them PopXXX, SetXXX, ClipChain, etc.

2. Additionally some types have had some redundant states shaved off,
for instance, rect no longer has *both* bounds and a clip_rect, as
the intersection of the two can be used. This was done a bit conservatively
as some adjustments will need to be done to the backend to fully eliminate
some states, and this can be done more incrementally.

2.5. As a minor side-effect of 2, we now early-reject some primitives whose
bounds and clip_rect are disjoint.

3. A HitTest display item has been added, which is just a Rect without
color. In addition to the minor space wins from this, this makes it much
easier to debug display lists

4. Adds a bunch of comments to the display list, making it easier to understand
things.

The end result of all these changes is a significantly smaller and easier to
understand display list. Especially on pages like gmail which have so many
clip chains. However this ultimately just makes text an even greater percentage
of pages (often 70-80%).

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

--HG--
extra : moz-landing-system : lando
2019-04-23 02:32:50 +00:00
Alexis Beingessner
e16f06e3b9 Bug 1536121 - cleanup display list code a little bit to prep for refactor. r=gw
* make all enums repr(u8) (compiler bug blocking this long fixed)
* add display list stats feature
* remove cache markers (abandoned design)
* don't always push empty SetFilters before PushStackingContext
* remove dead pub methods

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

--HG--
extra : moz-landing-system : lando
2019-04-23 02:32:48 +00:00
Glenn Watson
160bd46b0d Bug 1543356 - Visual glitches on resizing the browser with WebRender. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D27978

--HG--
extra : moz-landing-system : lando
2019-04-18 15:28:39 +00:00
Glenn Watson
d8c42a8290 Bug 1545006 - Use external scroll offsets to move primitives and clips into local space. r=kats
Use the external scroll offsets provided by Gecko to:
 (a) Offset primitives and clips by accumulated scroll offset.
 (b) Adjust the scroll transforms and hit test results.

This allows primitives and clips to be stored in a true local space,
that is consistent between display lists, even if scrolling has
occurred. This is a step towards planned picture caching improvements.

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

--HG--
extra : moz-landing-system : lando
2019-04-17 21:06:19 +00:00
Nicolas Silva
ddb01e5eb8 Bug 1519106 - Converge towards the max number of tiles faster. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D27728

--HG--
extra : moz-landing-system : lando
2019-04-17 14:41:47 +00:00
Nicolas Silva
d64ddb564e Bug 1519106 - Increase the maximum number of rasterized blob images per transaction. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D16190

--HG--
extra : moz-landing-system : lando
2019-04-17 14:43:37 +00:00
Doug Thayer
a632894d10 Bug 1539629 - Fix WR capture for multi-document use r=kvark
We fail the assertion at the beginning of GpuCache::begin_frame
right now because we run the extract_updates call after building
frames for every document. This just moves the extract_updates
work to be per-document.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 18:33:17 +00:00
Nicolas Silva
bd2c8b86cd Bug 1544374 - Make FilterOp not copy. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D27480

--HG--
extra : moz-landing-system : lando
2019-04-16 07:43:04 +00:00
Barret Rennie
96b41444c7 Bug 1444434 - Bind pixel pack buffer before trying to map it for readback r=gw
Differential Revision: https://phabricator.services.mozilla.com/D26946

--HG--
extra : moz-landing-system : lando
2019-04-15 23:39:10 +00:00
Doug Thayer
56b32c7614 Bug 1538710 - Remove disable-shrink pref r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D25134

--HG--
extra : moz-landing-system : lando
2019-04-15 22:34:51 +00:00
Doug Thayer
452bc370df Bug 1538710 - Move texture_cache cleanup to beginning of all frames r=bholley
... and ensure that, if we do cleanup, we generate frames for every document.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 22:34:43 +00:00