Commit Graph

553 Commits

Author SHA1 Message Date
sotaro
1f80fb5b98 Bug 1898142 - Deliver image usage type to WebRenderImageHost r=gfx-reviewers,lsalzman
Adds ImageUsageType to ImageClient and ImageContainer to identify user of Image at WebRenderImageHost.

Some ImageContainers are used only for allocating Image. Only following types calls ImageContainer::SetCurrentImages().
- ImageUsageType::Canvas
- ImageUsageType::OffscreenCanvas
- ImageUsageType::VideoFrameContainer

Differential Revision: https://phabricator.services.mozilla.com/D211147
2024-05-22 23:03:22 +00:00
Botond Ballo
8c6daf09fe Bug 1888904 - Remove the earlier check against emitting the same transform on nested WebRenderLayerScrollData nodes. r=tnikkel,hiro
This check, added in bug 1753779, should be made redundant by the
more robust check added in the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D207191
2024-04-24 23:38:26 +00:00
Botond Ballo
a3357a0ede Bug 1888904 - Try harder to avoid emitting the same transform on nested WebRenderLayerScrollData nodes. r=tnikkel,hiro
Differential Revision: https://phabricator.services.mozilla.com/D207190
2024-04-24 23:38:26 +00:00
Jeff Muizelaar
2a5a188e3b Bug 1872548 - Convert to MOZ_ASSERT inside GetBlobItemDataForGroup. r=gfx-reviewers,lsalzman
This code is pretty hot during display list building/grouping, so
let's only assert in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D197464
2024-01-01 00:34:32 +00:00
Andrew Osmond
11cefd8d0f Bug 1871613 - Ensure CanvasDrawEventRecorder releases external surface dependencies. r=gfx-reviewers,lsalzman
This patch makes CanvasDrawEventRecorder track what eventCount we
recorded an external surface reference. When the reader has increment
its processedCount above that, we will release our reference as it
should have acquired a strong reference to the data. This was previously
done when we forwarded the texture, but with remote textures, we no
longer have this event. Now we check when we start a new recording, or
attempt to clear cached resources.

Differential Revision: https://phabricator.services.mozilla.com/D197216
2023-12-23 01:34:31 +00:00
Karl Tomlinson
36e0e49ccf Bug 1863846 change VideoInfo::Rotation to non-nested enum class VideoRotation so that it can be forward declared r=aosmond,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D193163
2023-11-29 01:44:45 +00:00
Karl Tomlinson
481674434d Bug 1863846 convert MediaInfo::Rotation to WrRotation before creating a WebRender command r=aosmond
This adds some separation between MediaInfo.h and WebRender, avoiding the
include of MediaInfo.h in WebRenderMessages.h.

Depends on D193161

Differential Revision: https://phabricator.services.mozilla.com/D193162
2023-11-27 19:40:47 +00:00
Markus Stange
c82920a1e7 Bug 1853712 - Rename MustPaintOnContentSide to ShouldUseBlobRenderingForFallback (with inverted meaning). r=nical
Content-side isn't a good name anymore, now that it's only used on the parent process main thread.

Differential Revision: https://phabricator.services.mozilla.com/D188493
2023-09-25 23:36:28 +00:00
Markus Stange
e04361a36a Bug 1611626 - Simplify condition. r=nical
useBlobImage || paintOnContentSide is now always true.

Depends on D188489

Differential Revision: https://phabricator.services.mozilla.com/D188490
2023-09-25 23:36:26 +00:00
Markus Stange
cd95754542 Bug 1611626 - Remove gfx.webrender.blob-images. r=nical,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D188489
2023-09-25 23:36:26 +00:00
Timothy Nikkel
d3d717b6e3 Bug 1760747. Ensure that the bounds on the geometry of filter items are always limited by the building rect. r=jrmuizel
There are several paths in ComputeGeometryChange where we can allocate an geometry item for a filter item, but only one path that will call DetectContainerLayerPropertiesBoundsChange (which adjusts the bounds for filter items). Make sure this always happens in ComputeGeometryChange.

This was causing a bug where the geometry bounds were the full filter item height on the first paint (even though only part of the filter item was visible inside the building rect), but we did not call DetectContainerLayerPropertiesBoundsChange because it was the first paint where the filter item was visible. Then on the next paint the full filter item was visible, and there is no rect change to signal that we need to repaint.

Differential Revision: https://phabricator.services.mozilla.com/D187549
2023-09-11 22:00:30 +00:00
Timothy Nikkel
6836c392cd Bug 1844704. Some microoptimizations and cleanup of webrender group painting code. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D184191
2023-07-22 10:03:30 +00:00
Robert Longson
10b0d84c9a Bug 1831419 - check for singular matrix before drawing r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177886
2023-05-12 11:30:58 +00:00
Robert Longson
c3dff9154e Bug 1814398 - SVGImageElement should not derive from SVGGeometryElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168674
2023-04-29 15:13:34 +00:00
Timothy Nikkel
0fdcf45f5c Bug 1780191. Avoid making primitives smaller than one pixel active. r=nical
Webrender doesn't seem to handle them well. This of course will affect the balance of making things active, but hopefully this is a good trade off.

Differential Revision: https://phabricator.services.mozilla.com/D165726
2023-04-13 03:52:57 +00:00
Robert Longson
f0398b7f03 Bug 1820752 - Factor out webrender bounds assessment into its own function and avoid bounds checking if there's an active preceding sibling r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171854
2023-03-13 17:02:06 +00:00
Daniel Holbert
8aba9bb848 Bug 1818157: Backout changeset 510d250fd545 (bug 1814398) and e44b3ab61ae4 (bug 1817212) for introducing a performance regression. CLOSED TREE 2023-02-28 11:23:00 -08:00
Jonathan Kew
e2c069db1f Bug 1815404 - Replace most uses of gfxContext::CreateOrNull with stack-allocated contexts. r=gfx-reviewers,lsalzman
Depends on D170370

Differential Revision: https://phabricator.services.mozilla.com/D170371
2023-02-21 07:28:25 +00:00
Jonathan Kew
e998377ebb Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Robert Longson
32dd1416bc Bug 1814398 - SVGImageElement should not derive from SVGGeometryElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168674
2023-02-16 08:56:46 +00:00
Robert Longson
702b1a87a5 Bug 1817075 - Use nsIFrame::HasAnyStateBits() whenever possible instead of GetStateBits() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170006
2023-02-16 08:10:28 +00:00
Timothy Nikkel
3653e8bba7 Bug 1808062. Include stackingcontext helper scale when looking at size of items to determine if they should be active. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D165755
2023-01-04 10:57:47 +00:00
sotaro
623e2cb358 Bug 1805209 - Use RemoteTexture for WebGPU r=gfx-reviewers,lsalzman
WebGPU uses CompositableInProcessManager to push TextureHost directly from WebGPUParent to WebRender. But CompositableInProcessManager plumbing has a problem and caused Bug 1805209.

gecko already has a similar mechanism, called RemoteTextureMap. It is used in oop WebGL. If WebGPU uses RemoteTextureMap instead of CompositableInProcessManager, both WebGPU and oop WebGL use same mechanism.

WebGPUParent pushes a new texture to RemoteTextureMap. The RemoteTextureMap notifies the pushed texture to WebRenderImageHost.

Before the change, only one TextureHost is used for one swap chain. With the change, multiple TextureHosts are used for one swap chain with recycling.

The changes are followings.

- Use RemoteTextureMap instead of CompositableInProcessManager.
- Use RemoteTextureOwnerId instead of CompositableHandle.
- Use WebRenderCanvasData instead of WebRenderInProcessImageData.
- Add remote texture pushed callback functionality to RemoteTextureMap. With it, RemoteTextureMap notifies a new pushed remote texture to WebRenderImageHost.
- Remove CompositableInProcessManager.

Differential Revision: https://phabricator.services.mozilla.com/D164890
2022-12-23 20:41:02 +00:00
Botond Ballo
bcf265578a Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Emilio Cobos Álvarez
3cf9a9406c Bug 1800133 - Optimize out empty sublists a bit better. r=tnikkel
This avoids unnecessarily starting clip lists.

Depends on D161890

Differential Revision: https://phabricator.services.mozilla.com/D161891
2022-11-14 13:20:27 +00:00
Razvan Cojocaru
363946e17f Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Ashly Hale
f16707dc6a Bug 1786634 - Remove ImageMask.repeat field because it is always false r=gw
Remove some dead code.

Differential Revision: https://phabricator.services.mozilla.com/D159010
2022-10-11 23:54:28 +00:00
Jeff Muizelaar
25b41f5180 Bug 1776112 - Stop temporarily setting the building rect to the paint rect. r=mstange
This doesn't seem to serve any purpose anymore. MOZ_RELEASE_ASSERTing
if mBuildingRect is read during ::Paint doesn't show it happening
anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D150066
2022-06-23 15:04:27 +00:00
Nicolas Silva
2cbc007154 Bug 1772639 - Avoid potentially overflowing cast from float to int64 in FitsInt32. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148781
2022-06-13 08:37:30 +00:00
Miko Mynttinen
829f82a762 Bug 1758983 - Do not generate WR fallback data if translation overflows int32_t r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D141135
2022-06-02 14:16:58 +00:00
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