Commit graph

646 commits

Author SHA1 Message Date
Á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
Botond Ballo
5998e293bf Bug 1875180 - When defining a clip chain, print the ids of the clips in the chain. r=dlrobertson
Depends on D198884

Differential Revision: https://phabricator.services.mozilla.com/D198885
2024-01-18 20:04:45 +00:00
Botond Ballo
40eb5db184 Bug 1875180 - Use MOZ_LOG in WebRenderAPI.cpp. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D198884
2024-01-18 20:04:45 +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
7d06300567 Bug 1861605 - Use IDXGIResource1::CreateSharedHandle() instead of IDXGIResource::GetSharedHandle() r=gfx-reviewers,lsalzman
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().

The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.

HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.

Differential Revision: https://phabricator.services.mozilla.com/D192173
2023-12-19 09:23:21 +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
Glenn Watson
ac06fd0bb8 Bug 1836726 - Allow disabling subpixel AA in WR via preference r=gfx-reviewers,lsalzman
Previously, this was hard coded to off for android, on for everything
else. With this change, it's controlled by a preference which
defaults to off for android, and on for everything else. This allows
users to disable subpixel AA on desktop for performance reasons.

Differential Revision: https://phabricator.services.mozilla.com/D180009
2023-06-07 20:20:28 +00:00
sotaro
7041dbe0e8 Bug 1829592 - Suppress remote texture ready check when WebRenderAPI::FlushPendingWrTransactionEventsWithoutWait() is used r=gfx-reviewers,lsalzman
WebRenderAPI::FlushPendingWrTransactionEventsWithoutWait() does not wait remote texture ready. It should be OK, since it is called only in WebRenderBridgeParent::ClearResources(). But there were cases that hit the assert. The assert failure was false alarm.

The change suppresses assert of remote texture ready check in RemoteTextureMap::GetExternalImageIdOfRemoteTexture() if wait of the remote texture ready was skipped by the FlushPendingWrTransactionEventsWithoutWait().

Differential Revision: https://phabricator.services.mozilla.com/D176498
2023-04-28 00:23:30 +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
sotaro
9ca40310af Bug 1823352 - A little code cleanup in RenderThread r=gfx-reviewers,aosmond
Preparation for Bug 1804233

Differential Revision: https://phabricator.services.mozilla.com/D172981
2023-03-21 00:24:27 +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
4594ae314a 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
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
Fabrice Desré
f21d0cd9b0 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 01:44:07 +00:00
Sandor Molnar
ebec3db2d6 Backed out changeset f6188fe027b9 (bug 1817033) for causing webrender build bustages. CLOSED TREE 2023-02-16 03:21:59 +02:00
Fabrice Desré
4f9ae48be3 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 00:59:03 +00:00
David Shin
7640199d8a Bug 1792285 - Part 2: Do proper subpixel snapping before pushing iframe to WebRender. r=gfx-reviewers,gw
Differential Revision: https://phabricator.services.mozilla.com/D160063
2022-11-01 20:32:07 +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
Glenn Watson
829af78106 Bug 1778013 - Remove ClipId-style parenting from image clip masks public API r=gfx-reviewers,lsalzman
Also make the parent in ClipTemplate an Option, so that the
semantics are a bit clearer (follow up patches will remove this
parent field entirely).

Differential Revision: https://phabricator.services.mozilla.com/D150980
2022-07-05 08:20:49 +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
f92ac501b1 Bug 1776075 - Remove use of clip-id parenting in gecko r=gfx-reviewers,jrmuizel
Removes the last usage of the old-style clip-id parenting in
gecko. These paths passed the clip parent, but shouldn't be
necessary (all tests pass without them). Landing as a small
patch that's easy to bisect and back out if it does cause any
regression.

Differential Revision: https://phabricator.services.mozilla.com/D150050
2022-06-29 00:21:45 +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
sotaro
0484491b53 Bug 1765366 - Do not send transaction if renderer is already destroyed in WebRenderAPI::SendTransaction() r=gfx-reviewers,lsalzman
When WebRenderAPI::DestroyRenderer() is called at root WebRenderAPI, non-root WebRenderAPI should not sent transaction.

Differential Revision: https://phabricator.services.mozilla.com/D144020
2022-04-20 05:50:14 +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
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
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
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
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