Commit graph

523 commits

Author SHA1 Message Date
sotaro
268fa0828c Bug 1863257 - Remove sync wait in compositor thread of main thread canvas by RemoteTextureMap::WaitForRemoteTextureOwner() r=gfx-reviewers,lsalzman
Calling RemoteTextureTxnScheduler::NotifyTxn() of main thread canvas is deferred to WebRenderAPI for waiting RemoteTextureOwner at WebRenderAPI.

When RemoteTextureOwner is not registered yet, WaitingTextureOwner is used to register the callback. WaitingTextureOwner is removed in RemoteTextureMap::SuppressRemoteTextureReadyCheck() when it still exists.

Removing sync wait of off main thread canvas is going to be handled by another bug.

Differential Revision: https://phabricator.services.mozilla.com/D209647
2024-05-20 00:29:19 +00:00
Botond Ballo
b7116da08f Bug 1874199 - Add support for animation properties on StickyFrame spatial nodes. r=gw
The support is currently limited to translation transforms.

Depends on D208236

Differential Revision: https://phabricator.services.mozilla.com/D208237
2024-05-02 02:49:21 +00:00
pstanciu
06d741f4fa Backed out 4 changesets (bug 1874199) for causing WR bustages CLOSED TREE
Backed out changeset 0367fe61d2c9 (bug 1874199)
Backed out changeset 00d4835ec154 (bug 1874199)
Backed out changeset 4c6a338c5c30 (bug 1874199)
Backed out changeset 9756d029484d (bug 1874199)
2024-05-02 04:30:55 +03:00
Botond Ballo
25253183fb Bug 1874199 - Add support for animation properties on StickyFrame spatial nodes. r=gw
The support is currently limited to translation transforms.

Depends on D208236

Differential Revision: https://phabricator.services.mozilla.com/D208237
2024-05-02 00:14:01 +00:00
Álvaro Costa
9d3d894d68 Bug 1873121 - Expose ExternalScrollId in WebRender API. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D199589
2024-01-29 16:38:08 +00:00
sotaro
cfd47236fe Bug 1868928 - Handle ApplyAsyncImageForPipeline() for AsyncImagePipeline of sync WebRenderImageHost after waiting RemoteTextures ready at WebRenderAPI r=gfx-reviewers,lsalzman
This is preparation for Bug 1868927.

By deferring ApplyAsyncImageForPipeline() for TextureHost in AsyncImagePipeline of synchronous WebRenderImageHost, ApplyAsyncImageForPipeline() can be called after the RemoteTextureHostWrapper is in the ready state.

Differential Revision: https://phabricator.services.mozilla.com/D197320
2024-01-05 21:45:54 +00:00
Cosmin Sabou
b3bbb5ca75 Backed out changeset 22c07e92d841 (bug 1868928) for causing memory leaks. 2023-12-30 14:52:41 +02:00
sotaro
695be3b0cd Bug 1868928 - Handle ApplyAsyncImageForPipeline() for AsyncImagePipeline of sync WebRenderImageHost after waiting RemoteTextures ready at WebRenderAPI r=gfx-reviewers,lsalzman
This is preparation for Bug 1868927.

By deferring ApplyAsyncImageForPipeline() for TextureHost in AsyncImagePipeline of synchronous WebRenderImageHost, ApplyAsyncImageForPipeline() can be called after the RemoteTextureHostWrapper is in the ready state.

Differential Revision: https://phabricator.services.mozilla.com/D197320
2023-12-30 11:27:21 +00:00
Botond Ballo
9ee050bae2 Bug 1604280 - Implement an APZ minimap for WebRender. r=dlrobertson,gw
The APZ minimap is a debugging tool for Firefox developers, which can
be enabled with the pref apz.minimap.enabled.

When enabled, it shows a minimap overlay for every scroll frame, with
rects indicating the layout and visual viewports and the displayport.

We previously had an implementation for Layers that was removed when
Layers was removed. This patch is restoring an equivalent feature,
implemented for WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D190720
2023-12-21 19:02:32 +00:00
sotaro
031d0e5e65 Bug 1868729 - Use root API for sending transaction related to ImageBridge in WebRenderBridgeParent::ProcessWebRenderParentCommands() r=gfx-reviewers,lsalzman
When root API is not used, the transaction could be delayed at WebRenderAPI::SendTransaction(). When sending transaction related to ImageBridge, we do not want the delay.

Differential Revision: https://phabricator.services.mozilla.com/D195751
2023-12-07 10:46:00 +00:00
sotaro
f007a1547f Bug 1860203 - Add timeout check to WebRenderAPI::CheckIsRemoteTextureReady() r=gfx-reviewers,lsalzman
From Bug 1858047, it seems better to add timeout check to WebRenderAPI::CheckIsRemoteTextureReady().

Differential Revision: https://phabricator.services.mozilla.com/D191507
2023-10-24 00:13:44 +00:00
Glenn Watson
88bfe53304 Bug 1859942 - Remove unused remote pipelines from transaction r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D191375
2023-10-22 19:34:19 +00:00
sotaro
62a86ac73d Bug 1828088 - Handle wait of async RemoteTexture at WebRenderAPI r=gfx-reviewers,lsalzman
In current m-c, async RemoteTexture wait at RenderThread stops window update when the wait is too long. If async RemoteTexture is handled by WebRenderAPI, window could be updated during long async RemoteTexture wait.

async RemoteTexture wait of root WebRenderBridgeParent are disabled to simplify WebRenderAPI's wait handling.

offscreen canvas case is handled by WebRenderImageHost by Bug 1827578.

Differential Revision: https://phabricator.services.mozilla.com/D175590
2023-04-18 20:38:20 +00:00
Glenn Watson
92919fdce0 Bug 1824891 - Remove background color and viewport size from ScenePipeline r=gfx-reviewers,ahale
Differential Revision: https://phabricator.services.mozilla.com/D173795
2023-04-02 22:51:05 +00:00
Glenn Watson
6e6cfd149f Bug 1822436 - Remove offset from WR border-image implementation r=gfx-reviewers,lsalzman
It's not needed, as Gecko incorporates it in to the border-image rect.

Differential Revision: https://phabricator.services.mozilla.com/D172636
2023-03-15 20:51:37 +00:00
Marian-Vasile Laza
d9dcca62c0 Backed out changeset 82ff06193160 (bug 1822436) for wr wrench bustages. CLOSED TREE 2023-03-15 22:34:35 +02:00
Glenn Watson
30496845a0 Bug 1822436 - Remove offset from WR border-image implementation r=gfx-reviewers,lsalzman
It's not needed, as Gecko incorporates it in to the border-image rect.

Differential Revision: https://phabricator.services.mozilla.com/D172636
2023-03-15 20:01:20 +00:00
Chris Martin
b42c4425d0 Bug 1816559 - Remote compositor recording from GPU process r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D170514
2023-03-14 13:31:37 +00:00
Jonathan Kew
1b3e69f8aa 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
David Shin
96cf231f1f Bug 1792285 - Part 1: Refactor DisplayListBuilder::PushIFrame in preparation for proper subpixel snapping. r=emilio
Incoming `bounds` parameter is now `LayoutDeviceRect` in preparation for
proper subpixel snapping.

Differential Revision: https://phabricator.services.mozilla.com/D159884
2022-11-01 20:32:06 +00:00
Emilio Cobos Álvarez
42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Dan Robertson
affccc0acb Bug 1753019 - Use the animation id to identify hit testing metadata. r=botond,gw
## Summary

Pass the fixed position element animation id through webrender, returning the
the animation id in the hit-test result if the element is a fixed position
element. This animation id then can be used to lookup the relevant Hit-Testing
Tree Node, which can be used to find the fixed (or sticky) position side bits.

## Motivation

Sticky content can be currently stuck to the root content or not, based on the
scroll position. As a result, when hit testing sticky content, APZ needs both
the sticky position side bits and additional information to determine if the
element is currently stuck to the root content. This is needed to fix the
hit-testing of sticky position content when a APZ transform is being applied,
such as overscroll and hiding the dynamic toolbar.

## Implementation

The information needed to determine if a element is currently stuck to the root
content and the fixed/sticky position side bits is already stored in the
hit-testing tree node. Any hit test result should have a corresponding
hit-testing tree node entry. When a hit-test result contains a animation id and
a hit-testing tree node is found, we can store a pointer to this node and use
this to check the fixed/sticky position side bits. Something similar is already
done for hit test results when a scrollbar is hit.

Differential Revision: https://phabricator.services.mozilla.com/D148648
2022-07-04 18:14:58 +00:00
Glenn Watson
cebe610723 Bug 1768983 - Add prim flag for checkerboarding backgrounds r=gfx-reviewers,lsalzman
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.

Differential Revision: https://phabricator.services.mozilla.com/D146145
2022-05-15 21:54:25 +00:00
Brad Werth
26751bb55f Bug 1745492 Part 3: Expand WR YUV formats to include P010 as a MSB packing. r=lsalzman
P010 is trivially the same as NV12, but the 10-bit colors are packed into
the most significant bits instead of the least significant bits. This changes
the yuv shader to use the correct packing for P010. It treats P010 as its
own yuv format, which requires a lot of scaffolding.

Differential Revision: https://phabricator.services.mozilla.com/D140422
2022-03-05 17:31:19 +00:00
Nicolas Silva
50ca258be2 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
Hiroyuki Ikezoe
c0048dceb1 Bug 1571758 - Inform multiple sampled scroll offsets to WR and pick the most appropriate one in WR. r=botond
This change mitigates the gap between the external_scroll_offset informed from
the main-thread and scroll_offset informed from APZ.

Some wrench reftests for this change are in the next commit.

Differential Revision: https://phabricator.services.mozilla.com/D133444
2022-01-31 09:40:35 +00:00
Hiroyuki Ikezoe
860a49babe Bug 1571758 - Inform apz scroll generation to WebRender's ScrollFrame from the main-thread. r=botond
Also inform a flat representing whether the frame's document has scroll-linked
effect or not.

Differential Revision: https://phabricator.services.mozilla.com/D133442
2022-01-31 09:40:35 +00:00
Dzmitry Malyshau
d5354743fd Bug 1695318 - Pass the perspective association from CSS to WR r=gfx-reviewers,bradwerth
Depends on D136163

I have a feeling this isn't exactly the right way to pass this info, since the old WR code must have known about the perspective node without using my new flag.

Differential Revision: https://phabricator.services.mozilla.com/D136180
2022-01-19 22:41:12 +00:00
Hiroyuki Ikezoe
ce2aacf99b Bug 1744842 - Use LayoutVector2D to set scroll offset (the off main-thread part). r=gw,botond
This includes some other changes;

1) Rename relevant functions
  scroll_node_with_id -> set_scroll_offset
  scroll_node -> set_scroll_offset
  set_scroll_origin -> set_scroll_offset
2) Drop ScrollClamping argument
  In Gecko we didn't use ScrollClamping::ToContentBounds at all
3) The order of arguments of scroll_node_with_id

Differential Revision: https://phabricator.services.mozilla.com/D133145
2021-12-09 04:39:10 +00:00
Hiroyuki Ikezoe
952350bba4 Bug 1744842 - Use LayoutVector2D instead of LayoutPoint to set scroll offset (the main-thread part). r=gw,botond
Differential Revision: https://phabricator.services.mozilla.com/D133144
2021-12-09 04:39:10 +00:00
Hiroyuki Ikezoe
afd628b163 Bug 1742504 - Drop TransactionBuilder::UpdateScrollPosition. r=nical
It's not used at all. APZ uses TransactionWrapper::UpdateScrollPosition.

Differential Revision: https://phabricator.services.mozilla.com/D131860
2021-11-24 22:49:25 +00:00
Nicolas Silva
51efadfa3e Bug 1737648 - Don't batch uploads for items larger than a certain size. r=gfx-reviewers,bradwerth
The default size on most platforms is 256*256 which corresponds to the default blob tile size. I didn't check on android so I set it to 512*512 above which we never batch the upload so that the behavior is unchanged, but I suspect that a smaller threshold like 256*256 would also work better there.

On Windows with heavy blob image workloads, not batching gives a 20%-30% improvement to the time spent in update_texture_cache.

Differential Revision: https://phabricator.services.mozilla.com/D129516
2021-11-03 16:42:42 +00:00
Matt Woodrow
c897cc47f4 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
Nicolas Silva
cb6ac0df62 Bug 1690619 - Keep track of where the request to rendering something comes from. r=gfx-reviewers,mstange
This patch adds plumbing to keep track of why we request frames to be rendered.
This information is then displayed in gecko profile markers on the renderer thread as well as in profiler HUD counters (See "Render reasons" in profiler.rs).

Differential Revision: https://phabricator.services.mozilla.com/D127274
2021-10-05 12:54:39 +00:00
Nicolas Silva
0752cfb5cb Bug 1731610 - Add new prefs in WebRender with less boilerplate. r=gfx-reviewers,jrmuizel
Right now adding a dynamic pref for webrender involves plumbing in gfxPlatform, gfxVars, CompositBridgeParent, WebRenderBridgeParent, WebRenderAPI, the bindings, and then messaging the pref change to the right thread in WebRender.

That's quite a bit time consuming for something we tend to do for multiple things.

We already have a pretty good system for boolean debug prefs where the pref only needs to be listed in gfxPlatform and in the DebugPref enum of webrender_api/lib.rs, which has led us to use it for non-debug purposes.

This patch adds a system similar to the DebugFlags with values passed in a bitfield to be able to use gfxVars. In WebRender the parameters are key-value pairs which flow through the pipeline so that any component can react to them. A followup will add integer parameters.

The patch also moves a few prefs to this system and adds a pref to use PBO uploads.

Differential Revision: https://phabricator.services.mozilla.com/D126100
2021-09-23 15:17:46 +00:00
Matt Woodrow
fcd01e0c90 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
9640d7f5f3 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
Matt Woodrow
fbef6fe2ee Bug 1728050 - Move opacity flattening to be part of WR DL serialization. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124005
2021-09-10 03:43:32 +00:00
Nicolas Silva
0afcd4879b Bug 1729441 - Add a pref to set the blob tile size. r=gfx-reviewers,bradwerth
The prefs name is gfx.webrender.blob-tile-size and can be changed at runtime.

It changes the behavior of a wrench reftest that was ensuring that we don't crash with unreasonable tile sizes. The new behavior (sanitizing the tile size) means we can render the image while we would previously skip it.

Differential Revision: https://phabricator.services.mozilla.com/D124789
2021-09-08 12:41:51 +00:00
Marian-Vasile Laza
d25d135947 Backed out 7 changesets (bug 1728050, bug 1728251, bug 1728232, bug 1542929, bug 1714138, bug 1728258) for causing reftest failures. CLOSED TREE
Backed out changeset 41e053201cd3 (bug 1714138)
Backed out changeset 16ae9f5b4aa0 (bug 1728258)
Backed out changeset 414aa7ff05fe (bug 1542929)
Backed out changeset 7217ecf149c4 (bug 1728251)
Backed out changeset 405ff2ed2110 (bug 1728251)
Backed out changeset 3eec9e6c7218 (bug 1728232)
Backed out changeset 66038c15fe54 (bug 1728050)
2021-09-07 09:00:26 +03:00
Matt Woodrow
7e0f7ff766 Bug 1728050 - Move opacity flattening to be part of WR DL serialization. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D124005
2021-09-06 23:12:02 +00:00
Glenn Watson
38bfd81595 Bug 1728774 - Fix display item cache with retained DL builder. r=miko,gfx-reviewers
Fix a bug where the display item cache was not being reused from
frame to frame with retained display list builders.

At the same time, make the capacity recycling on the display list
serialization arrays a bit more realistic.

Differential Revision: https://phabricator.services.mozilla.com/D124412
2021-09-03 02:09:57 +00:00
Boris Chiou
665aaf6ed6 Bug 1676789 - Sample APZ animations before sampling OMTA animations for webrender. r=hiro
In order to support scroll-linked animations, we need the scrolling
information for sampling omt animations, so we would like to do APZ animations
first.

Now we clear the dynamic properties before sampling APZ and OMTA, so we
can make sure the pending properties are empty before appending new
ones. Therefore, let's just replace set_properties with add_properties
because OMTA sampler shouldn't override the current pending properties which
may be added by APZ sampler.

Differential Revision: https://phabricator.services.mozilla.com/D122308
2021-09-01 06:50:20 +00:00
Alexandru Michis
5a88076ff5 Backed out 3 changesets (bug 1676789) for causing webrender bustages.
Backed out changeset 93c46fbfe1cc (bug 1676789)
Backed out changeset a5b2e568f5cb (bug 1676789)
Backed out changeset ec14bf08defc (bug 1676789)
2021-09-01 07:51:37 +03:00
Boris Chiou
48f6308b1d Bug 1676789 - Sample APZ animations before sampling OMTA animations for webrender. r=hiro
In order to support scroll-linked animations, we need the scrolling
information for sampling omt animations, so we would like to do APZ animations
first.

Now we clear the dynamic properties before sampling APZ and OMTA, so we
can make sure the pending properties are empty before appending new
ones. Therefore, let's just replace set_properties with add_properties
because OMTA sampler shouldn't override the current pending properties which
may be added by APZ sampler.

Differential Revision: https://phabricator.services.mozilla.com/D122308
2021-09-01 04:26:53 +00:00
Jeff Muizelaar
ecd6741296 Bug 1728311 - Remove unused LayersMessages::TransactionInfo. r=aosmond
Fixes up some missing includes that accidentally worked before.

Differential Revision: https://phabricator.services.mozilla.com/D124060
2021-08-31 14:48:00 +00:00
Glenn Watson
8aaf20e99c Bug 1727458 - Change display list builder APIs to retain/reuse them r=gfx-reviewers,kvark
This will allow storing state in a display list builder struct
between different display list builds. In time, this will be used
to reduce the size of the serialized display list data, by only
sending delta changes to WR. The extra information made available
by sending deltas will then allow WR to more efficiently cache and
reuse information across different scene/frame builds.

Differential Revision: https://phabricator.services.mozilla.com/D123579
2021-08-30 23:10:10 +00:00
Glenn Watson
bc95f6481b Bug 1726708 - Add stable key for spatial nodes r=gfx-reviewers,kvark
Add an interface (and update Gecko to provide) a stable unique
identifier for each spatial node that is consistent across
display lists.

Although this patch doesn't _do_ anything useful with this yet,
we'll use this in future to allow interning, persisting and caching
a lot more information related to primitives and clips.

For now, it just asserts that the calling code never supplies a
duplicate unique identifier - which will be useful to have running
in nightly for a couple of weeks before starting to make use of
these identifiers.

Differential Revision: https://phabricator.services.mozilla.com/D123177
2021-08-30 00:33:22 +00:00
Glenn Watson
db30aac4f1 Bug 1724846 - Split DL spatial tree to separate payload r=gfx-reviewers,nical
This will allow experimenting with different representations of
the spatial tree (such as interning and/or providing stable
indices during display list building). It may also simplify
future changes to the public API to expose the spatial tree
directly.

As part of these changes, refactor how the debug representation
for the capture format is (de)serialized, to make it simpler to
add different payload vector types in future.

Differential Revision: https://phabricator.services.mozilla.com/D122183
2021-08-30 00:33:22 +00:00
Alexandru Michis
6b25d96a7d Backed out changeset 1d332a5ff4f9 (bug 1724846) for causing Bug 1727715.
CLOSED TREE
2021-08-26 22:51:05 +03:00