1784 Commits

Author SHA1 Message Date
Nicolas Silva
36d0b0407a Bug 1648703 - Use a custom vector growth pattern in PrimitiveList. r=gw
This greatly reduces the number of vector reallocations happening while building primitive lists. On the difficult cases like youtube front page the reduction is a bit more than 50%, and more in other pages I tested. More importantly it dramatically reduces the amount of the most expensive of these reallocations which are when the vector is starting to get large.

Differential Revision: https://phabricator.services.mozilla.com/D81725
2020-07-01 07:01:18 +00:00
Nicolas Silva
957d144600 Bug 1648323 - Skip the primitive if its clip mask does not intersect it. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D81700
2020-07-01 07:01:18 +00:00
Bert Peers
0c6a81a2b3 Bug 1648879 - SWGL on Windows upside down r=lsalzman
Fix ODR violation: type of GLboolean must match gleam, else the unsafe{}
glue code will corrupt the parameters (and go out of bounds in
GetBooleanv). "Composite" was getting a garbage value for "flip".

Differential Revision: https://phabricator.services.mozilla.com/D81618
2020-06-30 00:09:39 +00:00
Glenn Watson
391f840b9f Bug 1623792 - Pt 4 - Retain tile caches in render backend. r=nical,Bert
Previously, tile cache instances were destroyed and recreated
each time a new scene was created, as they were embedded inside
the picture primitives. An elaborate but complicated system was
used to retain important state (such as native surfaces, primitive
dependencies) across new scenes.

This patch moves the tile cache instances to be stored inside the
render backend. It removes the previous code for retaining state
for each tile cache. Instead, tile caches are created / reused /
destroyed during `new_async_scene_ready`.

This removes quite a bit of complexity. More importantly, it is
another step towards being able to cache and retain state such
as primitive tile assignments and visibility state across both
new frames and scenes.

Differential Revision: https://phabricator.services.mozilla.com/D81487
2020-06-29 20:48:16 +00:00
Bert Peers
b6fb32bf71 Bug 1648871 - debug draw crashes SWGL r=lsalzman
Guard against nullptr access of missing p.impl.
Also change LinkStatus so is_initialized is no longer true and calling
code can early out if bind_program fails.

Differential Revision: https://phabricator.services.mozilla.com/D81421
2020-06-27 00:17:33 +00:00
Glenn Watson
e8fefd230e Bug 1623792 - Store tile cache instances separately from picture primitives. r=Bert,nical
This is a partial step towards a larger change. The goal of this and the
follow up patches is to move the tile cache instances to be stored in
the render backend, rather than inside the picture / primitive tree.

This will allow better caching of dependency and visibility state
across both frame and scene builds for primitives. This has the potential
to significantly reduce or eliminate the amount of work we do per-frame
to track per-primitive visibility, clip-chain state and tile assignments.

A longer term goal is to allow correlating up-to-date tile caches with
pipeline display lists that haven't changed. This would allow WR to
skip scene building for content display lists that haven't changed, if
only the outer pipeline content has changed.

Differential Revision: https://phabricator.services.mozilla.com/D81284
2020-06-28 21:46:37 +00:00
Glenn Watson
1628e0582a Bug 1647862 - Fix panic when casting large rects to i32. r=Bert
In various parts of the picture and mask code, we were casting
the `clipped` rect to i32 (after rounding out). However, this
can cause overflow panics when the origin of the rect is too big.

Instead, treat the origin as f32 (which it was generally being
converted to anyway), and only cast the size part to be i32 as
required. This is safe since we know that the size has been
clipped to the visible screen, so will always be safe to cast
to i32.

Differential Revision: https://phabricator.services.mozilla.com/D80968
2020-06-28 22:00:56 +00:00
Cosmin Sabou
53dddceaa0 Backed out changeset ec2d3d359743 (bug 1647862) for refetest failures on css-simple-styling.html. CLOSED TREE 2020-06-26 07:58:54 +03:00
Glenn Watson
29c3ca7449 Bug 1647862 - Fix panic when casting large rects to i32. r=Bert
In various parts of the picture and mask code, we were casting
the `clipped` rect to i32 (after rounding out). However, this
can cause overflow panics when the origin of the rect is too big.

Instead, treat the origin as f32 (which it was generally being
converted to anyway), and only cast the size part to be i32 as
required. This is safe since we know that the size has been
clipped to the visible screen, so will always be safe to cast
to i32.

Differential Revision: https://phabricator.services.mozilla.com/D80968
2020-06-25 23:42:07 +00:00
Glenn Watson
a4c8032bbc Bug 1648328 - Remove a redundant assertion check. r=Bert
The code already explicitly checks for and handles the rect here
having a zero or invalid size, there is no need to assert that
the rect size itself is valid.

Differential Revision: https://phabricator.services.mozilla.com/D81249
2020-06-26 00:24:04 +00:00
Cosmin Sabou
6787ccf9b2 Backed out changeset 4114f7f22643 (bug 1647862) for causing wrench bustages. CLOSED TREE 2020-06-26 00:54:10 +03:00
Glenn Watson
0e14b7509e Bug 1647862 - Fix panic when casting large rects to i32. r=Bert
In various parts of the picture and mask code, we were casting
the `clipped` rect to i32 (after rounding out). However, this
can cause overflow panics when the origin of the rect is too big.

Instead, treat the origin as f32 (which it was generally being
converted to anyway), and only cast the size part to be i32 as
required. This is safe since we know that the size has been
clipped to the visible screen, so will always be safe to cast
to i32.

Differential Revision: https://phabricator.services.mozilla.com/D80968
2020-06-25 19:49:04 +00:00
Lee Salzman
0f03ab076c Bug 1645621 - gracefully downgrade to grayscale font smoothing in WR when necessary. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D80969
2020-06-25 03:01:04 +00:00
Glenn Watson
d4a5cd3f1d Bug 1647222 - Improve detection of real scroll frames. r=jnicol
We detect empty scroll roots by checking the valid scrollable size
of a frame, in order to avoid attaching picture cache slices to
these redundant scroll frames.

However, under some fractional zoom scenarios, rounding CSS pixels
to device pixels can result in small rounding errors.

Apply the same epsilon check that Gecko uses in APZ code in order
to detect if a scroll frame is actually scrollable.

Differential Revision: https://phabricator.services.mozilla.com/D80943
2020-06-24 19:37:56 +00:00
Nicolas Silva
ca942ccc84 Bug 1642629 - Preallocate the batches and batch rects vectors. r=gw
It would be wasteful to preallocate all batch builders because the majority of them have only a single batch, while typically only one will will have many batches. Thankfully we can acurately guess which pictures will produce many batches by checking whether they have more than one cluster.

Differential Revision: https://phabricator.services.mozilla.com/D80469
2020-06-24 12:49:51 +00:00
Nicolas Silva
0d9ad4dbe2 Bug 1642629 - Reserve sorted polygon list before pushing know number of split planes into it. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80438
2020-06-24 12:49:51 +00:00
Nicolas Silva
80b62b8fcd Bug 1642629 - Preallocate gpu cache texture vectors. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80437
2020-06-24 12:49:13 +00:00
Nicolas Silva
429bda5d65 Bug 1642629 - Reserve GpuBlockData vector before pushing in a loop. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80203
2020-06-24 12:49:13 +00:00
Nicolas Silva
440726b308 Bug 1642629 - Preallocate CompositeStateDescriptor vectors. r=kvark
Vector reallocations in CompositeState::push_surface are taking about 2% of total frame building time before this patch. There was an effort at preallocating some with constant values but I suspect these constants haven't been updated along with picture cachign heuristics.

Differential Revision: https://phabricator.services.mozilla.com/D80195
2020-06-24 12:48:22 +00:00
Nicolas Silva
cf618044db Bug 1642629 - Preallocate the primitive headers vector. r=kvark
This patch a simple utility to help with pre-allocating vectors that we can't recycle and use it with the primitive headers.

Differential Revision: https://phabricator.services.mozilla.com/D80194
2020-06-24 12:42:26 +00:00
Nicolas Silva
470f80670a Bug 1642629 - Recycle FrameVisibilityState's clip_chain_stack and surface_stack. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80193
2020-06-24 12:42:03 +00:00
Nicolas Silva
6bbff60830 Bug 1642629 - Reserve items in SegmentBuilder before simple loops. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80192
2020-06-24 12:41:50 +00:00
Nicolas Silva
79d0fcebc2 Bug 1642629 - Recycle shared clips allocation in picture.rs. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80178
2020-06-24 12:41:37 +00:00
Nicolas Silva
b1d4b4878a Bug 1642629 - Regroup recycled data structures into scratch buffers. r=gw
This change just restructures the recycling added in previouscommits.

Differential Revision: https://phabricator.services.mozilla.com/D80096
2020-06-24 12:41:14 +00:00
Nicolas Silva
9cac8b72d6 Bug 1642629 - Recycle dirty_region_stack in FrameBuilder. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79858
2020-06-24 12:40:41 +00:00
Nicolas Silva
bbc46b7620 Bug 1642629 - Recycle a couple of vectors in PictureUpdateState. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79857
2020-06-24 12:40:24 +00:00
Nicolas Silva
17be71bbe3 Bug 1642629 - Recycle the surface info vector in frame building. r=gw
This vector is usually small, but on some pages it can be fairly large (500+ in https://forum.xda-developers.com/redmi-note-3/development for example).

Differential Revision: https://phabricator.services.mozilla.com/D79855
2020-06-24 12:40:01 +00:00
Lee Salzman
62ba932186 Bug 1646835 - allow specifying backing data and stride for SWGL default framebuffer. r=jimb
For performance reasons in SWGL software compositors. to avoid unnecessary
full-screen copies of the framembuffer, we need to allow those compositors to
map their underlying widget surfaces and pass that buffer to SWGL so that they
can be directly rendered to. That also requires supporting custom strides, as
we can't always enforce the particular layout of the buffers handed off to us.
To that end, InitDefaultFramebuffer is generalized to take such information
and then many places where we rely on a specific hard-coded SWGL-calculated
stride have been altered to deal with a caller-supplied stride.

Differential Revision: https://phabricator.services.mozilla.com/D80267
2020-06-23 01:44:00 +00:00
Nicolas Silva
c5e5e1cbac Bug 1647742 - Move the prepare pass out of prim_store/mod.rs. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80692
2020-06-24 09:04:09 +00:00
Nicolas Silva
60ac872184 Bug 1647742 - Move the visibility pass out of prim_store/mod.rs. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80693
2020-06-24 09:03:08 +00:00
Nicolas Silva
0e4d3e634f Bug 1647299 - Store a single array of primitives per prim list instead of per-cluster. r=gw
After this change, clusters just keep a range of indices in the prim list's instance array.

Differential Revision: https://phabricator.services.mozilla.com/D80461
2020-06-24 09:02:50 +00:00
Cosmin Sabou
eb7d6e7782 Backed out 3 changesets (bug 1647742, bug 1647299) for causing build bustages. CLOSED TREE
Backed out changeset 47e04e14c6b5 (bug 1647742)
Backed out changeset 969b25c5e866 (bug 1647742)
Backed out changeset 9d1a0336fbe6 (bug 1647299)
2020-06-24 01:39:18 +03:00
Nicolas Silva
d992f4748f Bug 1647742 - Move the prepare pass out of prim_store/mod.rs. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80692
2020-06-23 19:24:54 +00:00
Nicolas Silva
5ea2220922 Bug 1647742 - Move the visibility pass out of prim_store/mod.rs. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D80693
2020-06-23 19:25:15 +00:00
Nicolas Silva
804c060ee1 Bug 1647299 - Store a single array of primitives per prim list instead of per-cluster. r=gw
After this change, clusters just keep a range of indices in the prim list's instance array.

Differential Revision: https://phabricator.services.mozilla.com/D80461
2020-06-23 19:24:11 +00:00
Noemi Erli
bbe92cb7fa Backed out 7 changesets (bug 1642629) for causing multiple failures and crashes CLOSED TREE
Backed out changeset 325a298e5e11 (bug 1642629)
Backed out changeset 2195069a75c9 (bug 1642629)
Backed out changeset a076f17ed2da (bug 1642629)
Backed out changeset 073fe13cd98b (bug 1642629)
Backed out changeset 88dd02d36e0d (bug 1642629)
Backed out changeset 683b75cdd3c4 (bug 1642629)
Backed out changeset 33d6d6b9097d (bug 1642629)
2020-06-22 15:10:18 +03:00
Nicolas Silva
7036817d6e Bug 1642629 - Recycle FrameVisibilityState's clip_chain_stack and surface_stack. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80193
2020-06-22 08:51:10 +00:00
Nicolas Silva
178669f284 Bug 1642629 - Reserve items in SegmentBuilder before simple loops. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80192
2020-06-22 08:50:50 +00:00
Nicolas Silva
7564409e4a Bug 1642629 - Recycle shared clips allocation in picture.rs. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80178
2020-06-22 08:50:38 +00:00
Nicolas Silva
de3b9e9e20 Bug 1642629 - Regroup recycled data structures into scratch buffers. r=gw
This change just restructures the recycling added in previouscommits.

Differential Revision: https://phabricator.services.mozilla.com/D80096
2020-06-22 08:54:49 +00:00
Nicolas Silva
65dd685282 Bug 1642629 - Recycle dirty_region_stack in FrameBuilder. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79858
2020-06-22 08:54:49 +00:00
Nicolas Silva
64e4930c6f Bug 1642629 - Recycle a couple of vectors in PictureUpdateState. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79857
2020-06-22 08:49:35 +00:00
Nicolas Silva
ebb2b1e263 Bug 1642629 - Recycle the surface info vector in frame building. r=gw
This vector is usually small, but on some pages it can be fairly large (500+ in https://forum.xda-developers.com/redmi-note-3/development for example).

Differential Revision: https://phabricator.services.mozilla.com/D79855
2020-06-22 08:49:13 +00:00
Daniel Lu
966189d812 Bug 1646172 - Added an event marker to the profiler that shows how many draw calls have been made in a frame. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79912
2020-06-18 22:17:54 +00:00
Jeff Muizelaar
6613f1b6b7 Bug 1646741 - Update gleam to 0.12. r=kvark
For stride calculation and SSBOs

Differential Revision: https://phabricator.services.mozilla.com/D80191
2020-06-18 18:11:13 +00:00
Coroiu Cristina
96536abc93 Backed out changeset 9367aa4b97e2 (bug 1646741) for wrench failures on a CLOSED TREE 2020-06-18 21:03:36 +03:00
Jeff Muizelaar
c326a65a01 Bug 1646741 - Update gleam to 0.12. r=kvark
For stride calculation and SSBOs

Differential Revision: https://phabricator.services.mozilla.com/D80191
2020-06-18 15:02:08 +00:00
Daniel Lu
ef0d982880 Bug 1646389 - Consolidated profiler markers for the number of picture cache tiles that are invalidated. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D80065
2020-06-18 13:06:49 +00:00
Glenn Watson
0f92ede9c2 Bug 1646279 - Remove primitive opacity collapse support. r=Bert,kvark
The code to support collapsing a picture with a single primitive
and an opacity filter into a primitive + opacity binding is
no longer an important optimization, due to picture caching.

Removing this old optimization also reduces complexity during
scene building, and slightly simplifies batching and picture
cache dependency tracking.

Differential Revision: https://phabricator.services.mozilla.com/D79975
2020-06-18 00:01:44 +00:00
Razvan Maries
5ae8a2d95b Backed out changeset 217914372d03 (bug 1642629) for WebRender bustages. CLOSED TREE 2020-06-17 02:35:32 +03:00