Commit Graph

523 Commits

Author SHA1 Message Date
Razvan Cojocaru
31f93c6a79 Bug 1767121 - Change the type of StackingContextHelper::mScale to MatrixScales. r=botond
Fix a minor typo while at it: "Inherrited" -> "Inherited".

Differential Revision: https://phabricator.services.mozilla.com/D146298
2022-05-19 01:45:52 +00:00
Nicolas Silva
a618a57e52 Bug 1686654 - Track CompositorHitTestInfo accross blob groups. r=jrmuizel
Before this patch the hit test info is accumulated in the painting loop of a group, there are two issues with that:
 - We can early out before getting to the painting loop if the group does not contain any visible item (hit test info items don't count as visible) so a nsDisplayCompositorHitTestInfo can be ignored if it is between two active items.
 - Group boundaries should not affect the behavior of hit testing.

With this patch, hit test info is accumulated in the ConstructItem loops, is not reset in EndGroup and is carried over from a group to the next.
This means the hit test flags are extended to the scope of the svg container, I'm not entirely sure that it's correct but I believe it is at least less incorrect than the current behavior.

Differential Revision: https://phabricator.services.mozilla.com/D145358
2022-05-10 08:05:08 +00:00
Nicolas Silva
d52af30d75 Bug 1686654 - Push hit test items for active items that are split off a group. r=jrmuizel
... if the group had hit test flags set.

This is more of a workaround than a proper fix. The general idea is that if we hadn't made the item active, its bound would have included in the group's hit tested bounds. Making the item active reduces the area that is covered by hit test items and we don't want that.

***
fixup

Differential Revision: https://phabricator.services.mozilla.com/D143755
2022-05-10 08:05:07 +00:00
Jeff Muizelaar
d9ad678d92 Bug 1764779 - Remove outdated comment about blob sizes.
This was fixed in bug 1582210.

Differential Revision: https://phabricator.services.mozilla.com/D144440
2022-04-22 16:15:40 +00:00
Nicolas Silva
25c40cb0d0 Bug 1761770 - Dont make non-uniformly scaled items active. r=jrmuizel
WebRender's AA doesn't look good with non-uniform scales, so we want to avoid exposing more content to it for now.

Depends on D142213

Differential Revision: https://phabricator.services.mozilla.com/D142214
2022-03-29 13:34:28 +00:00
Nicolas Silva
07d731c98b Bug 1761770 - Adjust item activity decisions. r=jrmuizel
Instead of reasoning about whether items should be active with a yes/no granularity, we consider whether it could/should be and have some logic to weight that against the risk of causing extra layerization when making containers active.
For example a small image *could* be made active, but we might not make it so if it causes extra layerization in cases where larger images would have been made active.

Differential Revision: https://phabricator.services.mozilla.com/D142213
2022-03-29 13:34:28 +00:00
Botond Ballo
58e12c251f Bug 1753779 - Avoid emitting the same deferred transform item onto an ancestor and descendant WebRenderLayerScrollData node. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D141064
2022-03-16 04:35:07 +00:00
Botond Ballo
13929c3bc7 Bug 1749190 - Try harder to avoid cyclic scroll metadata annotations when building WRScrollData. r=tnikkel
Depends on D137943

Differential Revision: https://phabricator.services.mozilla.com/D137944
2022-03-15 00:56:00 +00:00
Botond Ballo
5db29b7960 Bug 1749190 - Rename a variable to be more precise. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D137943
2022-03-15 00:55:59 +00:00
Lee Salzman
51030f7ed6 Bug 1511493 - Ensure PushGlyphs uses the current transaction's IpcResourceUpdateQueue. r=emilio
WebRenderBridgeChild::GetFontKeyForScaledFont can currently cause a IpcResourceUpdateQueue race.
If we're in the middle of a transaction building a blob image, GetFontKeyForScaledFont is called
in the blob image building code using the transaction's IpcResourceUpdateQueue as expected, such
that resource updates are sent out when the transaction is finalized.

However, TextDrawTarget calls into PushGlyphs without passing along its IpcResourceUpdateQueue,
calling GetFontKeyForScaledFont without it, and causing it to immediately send out the resource
update.

So if a blob image uses a font key and submits a resource update, but a display list is built
after that also using the font key within the transaction, the display list will fail to send
the resource update because it thinks the blob image already did, even though the blob image
transaction has not yet been finalized.

The simple fix is to just pass IpcResourceUpdateQueue from TextDrawTarget into PushGlyphs, thus
ensuring the resource updates are properly ordered.

Differential Revision: https://phabricator.services.mozilla.com/D140438
2022-03-05 23:35:16 +00:00
Marian-Vasile Laza
d34fed1602 Merge autoland to mozilla-central. a=merge 2022-02-23 19:49:43 -08:00
Nicolas Silva
eb4c3b629e Bug 1686654 - Ensure SwitchItem is called at the start of each blob group. r=jrmuizel
It was previously only called where we create a stacking context helper: before entering the grouping code and before pushing an active item into the wr display list, and not between the active items and the next blob group. This caused the leaf clip rect of the active item to leak into the next blob group.

Differential Revision: https://phabricator.services.mozilla.com/D136906
2022-02-23 13:43:38 +00:00
Nicolas Silva
55cceefeb1 Bug 1755747 - Add support for antialiased non-snapped rectangles. r=gfx-reviewers,aosmond
We need them for SVG primitives.

This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.

Differential Revision: https://phabricator.services.mozilla.com/D139024
2022-02-23 13:37:39 +00:00
Miko Mynttinen
528f0d244b Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 23:42:18 +00:00
Norisz Fay
baf6cd65cb Backed out 2 changesets (bug 1714584) per devs request for causing crashes a=backout
Backed out changeset 3baead3e079b (bug 1714584)
Backed out changeset a2da895a58ce (bug 1714584)
2022-02-22 16:41:57 +02:00
Miko Mynttinen
485b0007af Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 00:44:25 +00:00
Nicolas Silva
23e2ae83b7 Bug 1753404 - Track hit tested bounds separately from painted bounds. r=jrmuizel
This patch separates the tracking and submission of paint/hit-test rects, ensuring that we can remove invisible parts form the blobs without breaking hit testing.

Differential Revision: https://phabricator.services.mozilla.com/D139134
2022-02-21 21:57:03 +00:00
Nicolas Silva
4046d70029 Bug 1753404 - Avoid extra blob tiles from invisible items. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D137862
2022-02-21 21:57:03 +00:00
Andrew Osmond
16bded8b81 Bug 1754978 - Part 1. Refactor CompositableHandle infrastructure to allow in-process driven handles. r=sotaro
For WebGPU, we produce the textures in the compositor process and the
content process doesn't need to be that involved except for hooking up
the texture to the display list. Currently this is done via an external
image ID.

Given that WebGPU needs to work with OffscreenCanvas, it would be best
if its display pipeline was consistent whether it was gotten from an
HTMLCanvasElement, OffscreenCanvas on the main thread, or on a worker
thread. As such, using an AsyncImagePipeline would be best.

However there is no real need to bounce the handles across process
boundaries. Hence this patch which adds CompositableInProcessManager.
This static class is responsible for collecting WebRenderImageHost
objects backed by TextureHost objects which do not leave the compositor
process. This will allow WebGPUParent to schedule compositions directly
in future patches.

Differential Revision: https://phabricator.services.mozilla.com/D138588
2022-02-18 15:59:12 +00:00
Iulian Moraru
e38c48df42 Backed out 2 changesets (bug 1754978) for causing valgrind bustages.
Backed out changeset 491a985fc34a (bug 1754978)
Backed out changeset 98983bf9eaed (bug 1754978)
2022-02-18 00:36:31 +02:00
Andrew Osmond
e6c65476b6 Bug 1754978 - Part 1. Refactor CompositableHandle infrastructure to allow in-process driven handles. r=sotaro
For WebGPU, we produce the textures in the compositor process and the
content process doesn't need to be that involved except for hooking up
the texture to the display list. Currently this is done via an external
image ID.

Given that WebGPU needs to work with OffscreenCanvas, it would be best
if its display pipeline was consistent whether it was gotten from an
HTMLCanvasElement, OffscreenCanvas on the main thread, or on a worker
thread. As such, using an AsyncImagePipeline would be best.

However there is no real need to bounce the handles across process
boundaries. Hence this patch which adds CompositableInProcessManager.
This static class is responsible for collecting WebRenderImageHost
objects backed by TextureHost objects which do not leave the compositor
process. This will allow WebGPUParent to schedule compositions directly
in future patches.

Differential Revision: https://phabricator.services.mozilla.com/D138588
2022-02-16 22:23:19 +00:00
Andrew Osmond
e33da16d05 Bug 1754556 - Update WebGPU external image resource only after present is complete. r=kvark
This patch ensures that we only update the external image resource for
WebGPU when there has been an actual change for the resource. In order
to guarantee this, we wait for the present to complete, and only then
issue the update. WebRenderBridgeChild::SendResourceUpdates will also
trigger a frame generation if any resources were changed, which means we
don't need to trigger a paint on the frame itself anymore.

Note that we still have a race condition when we write into the
MemoryTextureHost while in PresentCallback, and the renderer thread may
be accessing the pixel data to upload to the GPU.

Differential Revision: https://phabricator.services.mozilla.com/D138349
2022-02-11 01:26:42 +00:00
Botond Ballo
8ca5317636 Bug 1751789 - Better handle the case where the deferred transform item's ASR is a descendant of the current item's ASR. r=tnikkel
Depends on D136828

Differential Revision: https://phabricator.services.mozilla.com/D136829
2022-01-27 01:08:21 +00:00
Botond Ballo
e1c61ea7dd Bug 1751789 - Move variables related to the deferred transform item into NewLayerData, and compute them before the recursion. r=tnikkel
It's valid to move their computations before the recursion because
their inputs (the current display item and the stacking context's
deferred transform item) do not change over the course of the
recursive call.

Depends on D136827

Differential Revision: https://phabricator.services.mozilla.com/D136828
2022-01-27 01:08:20 +00:00
Botond Ballo
e2e32e9dac Bug 1751789 - Move stopAtAsr into NewLayerData and compute it before the recursion. r=tnikkel
We are moving its computation before a balanced pair of
mAsrStack.push_back() and mAsrStack.pop() calls, so its
value remains the same.

Depends on D136826

Differential Revision: https://phabricator.services.mozilla.com/D136827
2022-01-27 01:08:20 +00:00
Botond Ballo
2e043e5274 Bug 1751789 - Introduce NewLayerData helper structure. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D136826
2022-01-27 01:08:19 +00:00
Andrew Osmond
8113ec1a93 Bug 1743761 - Ensure we invalidate substituted images when the preferred size is ready. r=tnikkel
Previously with ImageContainers, we would put the new preferred surface
into the ImageContainer. When we check if we should invalidate, it would
have a different image key, and hence invalidate the image frame and
schedule a paint.

With ImageProviders, it returns the same key in this case, because the
ImageProvider represents a particular surface. As such, we need to
actually track when we get a substituted ImageProvider, and invalidate
the image frame more aggressively to ensure we get the preferred size.

Differential Revision: https://phabricator.services.mozilla.com/D132583
2021-12-03 03:14:01 +00:00
Emilio Cobos Álvarez
595990bb1e Bug 1743310 - Remove paint flashing. r=gfx-reviewers,lsalzman
It's only meaningfully read in two places:

 * WebRender fallback code.
 * Some widget DEBUG-only code, which on Linux is ifdef'd and on Windows does
   some rather sketchy things like sleeping for 30ms

So I think it should be ok to remove, since WR fallback has its own flashing
pref as well, IIUC.

Differential Revision: https://phabricator.services.mozilla.com/D132313
2021-11-30 11:46:08 +00:00
Andrew Osmond
f1bbd40ad7 Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-11-27 11:47:40 +00:00
Jeff Muizelaar
24f4e5c457 Bug 1739551 - Don't bother storing the group bounds. r=mstange
We don't use it for anything anymore.

Differential Revision: https://phabricator.services.mozilla.com/D130432
2021-11-05 20:39:02 +00:00
Jeff Muizelaar
06996cbed2 Bug 1739542 - Switch a bunch of IntRects to LayerRects. r=mstange
This makes the coordinate space more obvious. They were IntRects to make it
easier during development to be sloppy.

Differential Revision: https://phabricator.services.mozilla.com/D130423
2021-11-05 20:25:23 +00:00
Sandor Molnar
5c9a4c3ee8 Backed out 13 changesets (bug 1711061) on devs request. CLOSED TREE
Backed out changeset c4f073f7e3a3 (bug 1711061)
Backed out changeset aced4b672fb4 (bug 1711061)
Backed out changeset 3687e798f665 (bug 1711061)
Backed out changeset 7b471990ea86 (bug 1711061)
Backed out changeset 1014a95f540e (bug 1711061)
Backed out changeset a37b3091281d (bug 1711061)
Backed out changeset 96a0ef35881b (bug 1711061)
Backed out changeset 38890cc266fb (bug 1711061)
Backed out changeset be73004c0850 (bug 1711061)
Backed out changeset b964576ae53d (bug 1711061)
Backed out changeset d453c5219255 (bug 1711061)
Backed out changeset 0145b538175b (bug 1711061)
Backed out changeset 41ba2e2a2d13 (bug 1711061)
2021-10-29 00:36:30 +03:00
Andrew Osmond
81b502e414 Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-10-27 01:24:35 +00:00
Sandor Molnar
8213f51c9d Backed out 13 changesets (bug 1711061) for causing browser-chrome failures in test/performance/browser_startup_images. CLOSED TREE
Backed out changeset 5988220f56b8 (bug 1711061)
Backed out changeset cb7721d7ce49 (bug 1711061)
Backed out changeset 343746ffae73 (bug 1711061)
Backed out changeset 000940244dcf (bug 1711061)
Backed out changeset 27565d5ae08d (bug 1711061)
Backed out changeset f3b2379d971b (bug 1711061)
Backed out changeset d4b3d0fa1771 (bug 1711061)
Backed out changeset 9af5b3f2225f (bug 1711061)
Backed out changeset da992effeff1 (bug 1711061)
Backed out changeset 6b2bc6c16b9f (bug 1711061)
Backed out changeset ac2792d42be2 (bug 1711061)
Backed out changeset cb00177e655e (bug 1711061)
Backed out changeset 8d5261184226 (bug 1711061)
2021-10-26 18:04:34 +03:00
Andrew Osmond
0babc463c4 Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-10-26 13:28:27 +00:00
Jeff Muizelaar
c5190dd411 Bug 1736705 - Use ScreenReference DrawTarget instead of creating one from scratch. r=aosmond
This reduces the overhead (mostly heap allocations) when there are lots
of individual layers like on the SVG bouncing circles motionmark test.
https://share.firefox.dev/3jihjfc

Differential Revision: https://phabricator.services.mozilla.com/D129047
2021-10-20 16:45:59 +00:00
Jeff Muizelaar
bfbc15e62a Bug 1736697 - Remove code for checking layer size. r=mstange
The users of this were removed with FrameLayerBuilder.
Two callers that passed true remained: one was a print
statement, and the other should be fine to change.

Differential Revision: https://phabricator.services.mozilla.com/D128946
2021-10-20 16:33:04 +00:00
Jeff Muizelaar
7533735bf0 Bug 1736476 - Drop aData->mInvalid check. r=mstange
This was added in bug 1487903 but doesn't seem to be needed anymore. The test
case from that bug still works and we now do invalidation of masks and filters
differently.

Differential Revision: https://phabricator.services.mozilla.com/D128822
2021-10-19 15:44:39 +00:00
Jeff Muizelaar
a149425349 Bug 1736229 - Remove unused mImageRect. r=mstange
The uses of mImageRect were removed in bug 1582152.

Differential Revision: https://phabricator.services.mozilla.com/D128685
2021-10-18 14:12:17 +00:00
Jeff Muizelaar
170874e13c Bug 1736077 - Remove unusued LayerManager.cpp. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128632
2021-10-17 01:28:41 +00:00
Jeff Muizelaar
ac7cdee529 Bug 1736033 - Remove invalidation suppression. r=mstange
This doesn't appear to be needed. If there are any invaliations
that happen inside of ConstructGroupInsideInactive they should be
overridden by InvalidateRect() for the container.

Differential Revision: https://phabricator.services.mozilla.com/D128598
2021-10-16 01:46:48 +00:00
Jeff Muizelaar
5407713fb6 Bug 1734675 - SVG_WRAPPER items shouldn't ever be hitting this fallback path. r=mstange
Let's ensure this before ripping out the test below.

Differential Revision: https://phabricator.services.mozilla.com/D127851
2021-10-07 20:00:55 +00:00
Matt Woodrow
7349b0d54e Bug 1730682 - Merge clips when flattening opacity. r=miko
This is required to get tests to pass without fuzz on Android.

Depends on D125633

Differential Revision: https://phabricator.services.mozilla.com/D127513
2021-10-05 20:47:30 +00:00
Matt Woodrow
41a2e11a41 Bug 1730682 - Flatten opacity before setting up clips. r=miko
Pushing the clip for the opacity item into the clip manager has a non-trivial cost, so we get better performance if we handle flattening the item before that.

Differential Revision: https://phabricator.services.mozilla.com/D125633
2021-10-05 20:47:30 +00:00
criss
c658e63004 Backed out changeset ae6e736dc962 (bug 1730682) for casuing reftest failures on display-list 2021-09-28 00:35:57 +03:00
Matt Woodrow
477fabe14a Bug 1730682 - Flatten opacity before setting up clips. r=miko
Pushing the clip for the opacity item into the clip manager has a non-trivial cost, so we get better performance if we handle flattening the item before that.

Differential Revision: https://phabricator.services.mozilla.com/D125633
2021-09-27 19:49:31 +00:00
Matt Woodrow
e76956c865 Bug 1730314 - Handle opacity flattening within GenerateFallbackData. r=jrmuizel
Other items types that support flattening return false from CanHandleOpacity if their CreateWebRenderCommands implementation will fail. That's really hard to determine in advance for text, so it's simpler to just handle the opacity in the fallback path too.

Differential Revision: https://phabricator.services.mozilla.com/D125634
2021-09-22 01:19:55 +00:00
Emilio Cobos Álvarez
4560565b6b Bug 1731138 - Invalidate WebRender mask data from css::ImageLoader. r=tnikkel
Otherwise we don't properly repaint animated images.

Differential Revision: https://phabricator.services.mozilla.com/D126093
2021-09-21 11:18:58 +00:00
Matt Woodrow
fbf3f268a3 Bug 1728050 - Move opacity flattening to be part of WR DL serialization. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124005
2021-09-13 05:01:33 +00:00
criss
3f0efebda9 Backed out 10 changesets (bug 1714138, bug 1542929, bug 1728232, bug 1729236, bug 1728258, bug 1728251, bug 1728050) for causing bug 1424348 a=backout
Backed out changeset c5b71e6ce0e5 (bug 1729236)
Backed out changeset c6bcc4ed3d2e (bug 1729236)
Backed out changeset 7e292895282a (bug 1729236)
Backed out changeset d9ddd915e0c2 (bug 1714138)
Backed out changeset 82b98d2f0dcf (bug 1728258)
Backed out changeset 9a84a36b9dc4 (bug 1542929)
Backed out changeset 96be978630ff (bug 1728251)
Backed out changeset d7a8bf19d849 (bug 1728251)
Backed out changeset cce0c53b439f (bug 1728232)
Backed out changeset 3afd6aee7849 (bug 1728050)
2021-09-12 12:00:30 +03:00