Граф коммитов

2709 Коммитов

Автор SHA1 Сообщение Дата
Brad Werth 77aa170cdd Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers. r=mstange
This makes the macOS native compositor claim the ability to handle color
layers and makes NativeLayerCA actually do it. Color layers have a different
structure than other layers. Color layers apply the color to the
wrappingCALayer, and have no contentCALayer at all. That means that the
color layers are always sized to the layer's clip rect.

This also contains a drive-by fix to handle the case where an mOpaquenessTintLayer
exists when mMutatedSpecializeVideo is set to true. Before this change, in such a
case, the opaqueness layer will not be associated with the recreated wrapping layer.

Differential Revision: https://phabricator.services.mozilla.com/D128545
2022-05-26 15:24:13 +00:00
Brad Werth 49ab728ca4 Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. r=gw
This only allows native compositors to claim this capability, without changing
any compositors to do so. In Part 4, the macOS native compositor claims this
capability in conjunction with adding the code that handles the color layers.

Differential Revision: https://phabricator.services.mozilla.com/D127175
2022-05-26 15:24:12 +00:00
Brad Werth 4af362a7f6 Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. r=gw
This is all scaffolding that will be used by later parts of this patch
series.

Differential Revision: https://phabricator.services.mozilla.com/D128130
2022-05-26 15:24:12 +00:00
Glenn Watson 87b9699e0a Bug 1769963 - Fix backdrop-filter inside complex transform with CSS filter chain r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147124
2022-05-25 02:59:32 +00:00
sotaro 4f8549101c Bug 1766282 - Do not use SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy r=jgilbert,jrmuizel,gfx-reviewers
With CI's NVIDIA GPU, SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy caused rendering problem. When SharedHandle is not used, the rendering problem did not happen. But when video is rendered to WebGL texture, SharedHandle need to be used.
In this case, D3D11TextureIMFSampleImage copies original ID3D11Texture2D to a new ID3D11Texture2D and use a shared handled of the copied texture. And no video copy of future video frames are disabled.

NoCopyNV12Texture is renamed to ZeroCopyNV12Texture to clarify its meaning.

Differential Revision: https://phabricator.services.mozilla.com/D144598
2022-05-20 04:37:53 +00:00
sotaro 15b053536d Bug 1769900 - Add more logs of window size sanity check around nsWindow r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146658
2022-05-18 15:15:41 +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 0b576b939a Bug 1768791 - Add overlay support information to about:support r=jrmuizel,gfx-reviewers
The information is similar to chromium's overlay support information.

Differential Revision: https://phabricator.services.mozilla.com/D146042
2022-05-11 15:10:30 +00:00
Bas Schouten ef6615b08f Bug 1767257: Migrate existing WebRender telemetry probes to use Glean directly. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D145315
2022-05-09 15:23:11 +00:00
Cosmin Sabou fa2ede0aba Backed out changeset 50ba61f5cf8c (bug 1767257) for causing webrender bustages. CLOSED TREE 2022-05-09 17:31:06 +03:00
Bas Schouten 5f53bddb5e Bug 1767257: Migrate existing WebRender telemetry probes to use Glean directly. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D145315
2022-05-09 13:46:51 +00:00
Mike Hommey 1663cab462 Bug 1766561 - Add missing l modifier for HRESULT formatting. r=media-playback-reviewers,gfx-reviewers,nika,necko-reviewers,rkraesig,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144915
2022-05-03 20:49:07 +00:00
Mike Hommey dace8a4e06 Bug 1766561 - Use %p for pointer types. r=gfx-reviewers,rkraesig,nika,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D144913
2022-05-03 20:49:06 +00:00
Dan Robertson 47b6f96706 Bug 1676299 Part 4: Modify BaseMatrix::ScaleFactors() to return a ScaleFactors2D. r=botond
This changes BaseMatrix::ScaleFactors() to return a ScaleFactors2D instead of
a SizeTyped.

Depends on D145041

Differential Revision: https://phabricator.services.mozilla.com/D144666
2022-04-30 01:35:24 +00:00
Jamie Nicol 2e495f6789 Bug 1731980 - Ensure SurfaceTextures with transforms get rendered at correct size. r=gfx-reviewers,lsalzman
On Android we use SurfaceTextures to render content from sources such
as the video decoder. These may have a transform set which is supposed
to be applied to the texture coordinates used to sample the
texture. Webrender (and software webrender), however, do not handle
this correctly, meaning videos may be rendered at the incorrect size
on some devices.

SurfaceTextures should always be rendered with their bottom-left being
their origin, eg vertically flipped. Additionally, the texture
transform returned on most devices seems to be a simple y-flip
transform with no scaling. Webrender currently just ignores the y-flip
due to the texture origin, which cancels out us not handling the
y-flip from the transform, meaning video looks correct on most
devices. Some devices, however, do return a scaling transform which we
must handle.

This patch removes the override of WebRenderTextureHost::NeedsYFlip()
that was causing us to ignore the y-flip due to the texture origin -
since we will now apply the transform we must handle this correctly
too.

It adds a virtual method RenderTextureHost::GetUvCoords(), that
returns the texture coordinates that should be used by webrender to
sample from external textures. In most cases these are simply (0, 0)
and (size.x, size.y), but in RenderAndroidSurfaceTextureHost we
override this function to apply the transformation. This ensures we
use the correct coordinates whenever the texture is rendered by
webrender, eg in both software and hardware webrender when rendering
in the non-compositing-path, and by hardware webrender's draw
compositor. Additionally, the composite.glsl shader requires a fix to
calculate the UV bounds correctly, as the coordinates may now be
inverted.

Lastly, we fix software webrender with the OpenGL
compositor. CompositorOGL already has the required functionality to
apply the texture transformation as it was used back in the layers
days. We must simply ensure that we pass the value of the
mIgnoreTransform flag from the original SurfaceTextureHost, through to
the RenderAndroidSurfaceTextureHost, and finally to the
SurfaceTextureSource which we hand to CompositorOGL.

Differential Revision: https://phabricator.services.mozilla.com/D144306
2022-04-25 16:47:51 +00:00
ganguin fc2a921247 Bug 1661450 - 1/8 Guard X11 specific code with MOZ_X11 r=stransky
Add MOZ_X11 ifdefs on X11 specific code, mainly alongside GdkIsX11Display.

Differential Revision: https://phabricator.services.mozilla.com/D139526
2022-04-20 09:32:07 +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
sotaro 0054e1bdb2 Bug 1736479 - Make gfx SanityTest.jsm work again r=gfx-reviewers,bradwerth
If we want to re-enable SanityTest.jsm test, we need to disable native compositor(DirectComposition) on the testing window, since taking snapshot of native compositor is very slow on Windows. Then CompositorOptions could be used to notice to disable native compositor(DirectComposition).
To notice it from SanityTest.jsm to gecko, nsIAppWindow::needFastSnaphot() is used.

Differential Revision: https://phabricator.services.mozilla.com/D130824
2022-04-20 01:08:52 +00:00
criss 8d62d22b30 Backed out 10 changesets (bug 1661450) for causing build bustages on nsWindow.cpp. CLOSED TREE
Backed out changeset 2c41d82de0c5 (bug 1661450)
Backed out changeset 5f58fcd7ac0b (bug 1661450)
Backed out changeset 62e56a6dcd22 (bug 1661450)
Backed out changeset 4b422ffa729f (bug 1661450)
Backed out changeset 6ca4705772da (bug 1661450)
Backed out changeset 031a6313459f (bug 1661450)
Backed out changeset 06ddf05e97d6 (bug 1661450)
Backed out changeset 4388b1b9aafd (bug 1661450)
Backed out changeset 600f9fd09fa6 (bug 1661450)
Backed out changeset cc5e8efe3ebf (bug 1661450)
2022-04-19 12:25:14 +03:00
ganguin 936e3f0555 Bug 1661450 - 1/8 Guard X11 specific code with MOZ_X11 r=stransky
Add MOZ_X11 ifdefs on X11 specific code, mainly alongside GdkIsX11Display.

Differential Revision: https://phabricator.services.mozilla.com/D139526
2022-04-19 08:35:26 +00:00
sotaro c7f48c370b Bug 1765214 - Fix DCSurfaceVideo::mSwapChainSurfaceHandle initialization r=gfx-reviewers,jrmuizel
DCSurfaceVideo::mSwapChainSurfaceHandle is not initialized. It causes invalid handle close in DCSurfaceVideo::ReleaseDecodeSwapChainResources().

Differential Revision: https://phabricator.services.mozilla.com/D143966
2022-04-19 01:41:03 +00:00
Brad Werth b579f7cdc5 Bug 1763782 Part 1: Allow AV1 10-bit to be decoded. r=gfx-reviewers,jgilbert
This decodes 10-bit AV1 into the P010 surface format. Because of the
needed bit shifting to move the 10-bits to the MSB positions, it can't use
a straight memcpy for the Y values.

Differential Revision: https://phabricator.services.mozilla.com/D143436
2022-04-19 01:06:29 +00:00
Nika Layzell 6c4dce02a1 Bug 1713773 - Part 1: Simplify nsThreadManager shutdown, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D142600
2022-04-12 20:22:24 +00:00
Iulian Moraru 4ab566ae1b Backed out changeset 75811190935c (bug 1713773) for causing leaks on mutex/nsthread. 2022-04-11 19:01:16 +03:00
Nika Layzell 017ada70cf Bug 1713773 - Simplify nsThreadManager shutdown, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D142600
2022-04-11 14:33:45 +00:00
Nicolas Silva 752a0ee047 Bug 1763405 - Use a higher priority for the renderer thread. r=gfx-reviewers,jnicol
The renderer thread is at the end of the rendering pipeline. For smoothness it is important that it completes its work quickly as soon as it receives some. It does not produce work for other threads so we don't risk of causing some build up. On the other hand, the higher priority will help with with avoiding some cases of congestion of work coming from the content process.

This only bumps the priority of the renderer thread as opposed to the entire GPU process (Blink does the latter). This is because we currently have too many thread on the GPU process so there is a risk of completely starving other processes. It's still something we want to consider and might be safer after we have done the work of reducing the number of threads.

Differential Revision: https://phabricator.services.mozilla.com/D143056
2022-04-07 09:37:45 +00:00
Lee Salzman 914e4af30a Bug 1761437 - Ensure the shared font namespace is allocated by the client. r=gw
The shared font namespace was getting allocated by the RenderBackend, while
we otherwise allocated namespaces for documents on the client. We need to make
sure that if namespace allocation happens on the client, that it also happens
on the client for the shared font namespace. This adds to RendererOptions to
make passing in a shared font namespace allocated by the client possible.

Differential Revision: https://phabricator.services.mozilla.com/D142381
2022-03-29 20:46:36 +00:00
sotaro f0edec0bb1 Bug 1761906 - Call DCSurfaceVideo::PresentVideo() only when it is necessary r=gfx-reviewers,jrmuizel
DCSurfaceVideo::PresentVideo() needs to be called only when RenderTextureHost, swapChainSize or VideoSwapChain are updated.

Since bug 1667303 fix, DCSurfaceVideo::PresentVideo() is called even when it is not necessary.

Differential Revision: https://phabricator.services.mozilla.com/D142315
2022-03-29 14:12:45 +00:00
Andrew Osmond dfd75c103a Bug 1761832 - Protect GLLibraryEGL singleton against race conditions. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D142257
2022-03-28 21:16:58 +00:00
sotaro 56ef111fbd Bug 1667303 - video scaling at VideoProcessor for overlay video if possible r=gfx-reviewers,jrmuizel
Video scaling by VideoProcessor is expected to reduce GPU usage.

Differential Revision: https://phabricator.services.mozilla.com/D91392
2022-03-18 14:46:05 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Lee Salzman 2cbc657add Bug 1758555 - Share font keys across multiple namespaces within a Renderer. r=nical,gfx-reviewers
This replaces the sharing of SharedFontInstanceMap with a new structure
SharedFontResources that can be used to trade a mechanism between threads
of a single Renderer instance for de-duplicating fonts and font instances.

SharedFontResources stores maps of FontTemplates and FontInstances as well
as a new FontKeyMap and FontInstanceKeyMap which handles the mapping of
namespace-local font keys to a shared key. The shared key then maps to
the real, de-duplicated resource (template or instance) which has a lifetime
beyond that of any individual namespace that may refer to it. Reference
counting is used to track the lifetime of the shared key so that when no key
map entries refer to the shared key any longer, it will then expire and
be cleaned up. This does cause some complications with clearing a namespace
in that rather than simply crawling through a table looking for resources
with a given IdNamespace, we have to check for shared keys that have expired
when clearing a namespace caused the last references to their mappings
to be removed.

Given that ApiResources handles the up-front addition of font templates
and instances, while ResourceCache within the RenderBackend handles deletion,
most of these mappings have to be shared between threads, which is why they
live within SharedFontResources. When resource updates are processed by
either ApiResources or ResourceCache, we create a shared key as necessary to
add the font resource, and then delete the shared font resource when a resource
update caused the last reference to the resource's shared key to expire.

This only tries to de-duplicate fonts within a single Renderer (window). Since
each Renderer has its own texture cache and dependent glyph cache, sharing
across multiple windows would require extra complication with storing font
bitmaps outside of the texture cache and outside the Renderer instance itself.
For the sake of simplicity and to better understand how de-duplication impacts
performance, this patch only tries to address sharing within a single window.

Differential Revision: https://phabricator.services.mozilla.com/D140561
2022-03-11 10:15:02 +00:00
Florian Quèze 9c9aca9d89 Bug 1757202 - Include the inner window id in the existing Composite markers, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139731
2022-03-11 07:49:05 +00:00
Lee Salzman f3b77352e6 Bug 1758736 - Support RG16 textures in SWGL. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D140716
2022-03-10 16:36:05 +00:00
sotaro cb830217d5 Bug 1758618 - Add error log to mVideoSwapChain->Present() r=jrmuizel
Error log helps to understand the problem.

Differential Revision: https://phabricator.services.mozilla.com/D140602
2022-03-09 06:25:39 +00:00
sotaro 7991ca6079 Bug 1757879 - Make SimulateDeviceReset() similar to actual device reset handling r=ipc-reviewers,gfx-reviewers,lsalzman,mccr8
SimulateDeviceReset() works differently from actual device reset handling. It seems better to make SimulateDeviceReset() more similar to actual device reset handling.

Differential Revision: https://phabricator.services.mozilla.com/D140161
2022-03-08 23:14:28 +00:00
sotaro a7eb2e3d49 Bug 1757710 - Add fallback handling of video overlay from YUV SwapChain to RGB SwapChain r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D140507
2022-03-08 23:13:05 +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
sotaro 33ec38c192 Bug 1757698 - Add D3D11TextureIMFSampleImage and array index handling to D3D11TextureData r=jgilbert,gfx-reviewers,jrmuizel
This is a preparation of Bug 1723207.

D3D11TextureIMFSampleImage is used for storing ID3D11Texture2D of IMFSample. Array index handling is added, since there are cases that hardware decoder uses array texture. D3D11TextureIMFSampleImage is expected to be used in GPU process.

Differential Revision: https://phabricator.services.mozilla.com/D140017
2022-03-03 02:30:28 +00:00
Jeff Muizelaar 96997a4322 Bug 1757574 - Reduce the maximum number of high priority WrWorker threads. r=nical
This cuts the time spent doing get_ct_font on macOS in half because of
various contention issues. It should also reduce overall memory usage
for large fonts because we have half as many threads loading the
fonts.

Differential Revision: https://phabricator.services.mozilla.com/D139946
2022-03-02 15:27:31 +00:00
Lee Salzman 619a501c21 Bug 1757449 - Make WR NativeFontHandle use String instead of CGFont on macOS. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139882
2022-03-02 10:11:05 +00:00
criss b13da6025c Backed out changeset e0f1d94942ce (bug 1757449) for causing build bustages on macOs. CLOSED TREE 2022-03-02 12:02:50 +02:00
Lee Salzman a3df467ef4 Bug 1757449 - Make WR NativeFontHandle use String instead of CGFont on macOS. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139882
2022-03-02 09:34:31 +00:00
Lee Salzman 0e447bde60 Bug 1757111 - Report cropped YCbCr sizes in RenderExternalTextureHost. r=jrmuizel
I had assumed in bug 1750858 that we would only need to modify RenderBufferTextureHost.
It turns out macOS will also still use the ffmpeg decoder and so RenderExternalTextureHost
must report cropped YCbCr sizes as well.

Differential Revision: https://phabricator.services.mozilla.com/D139679
2022-02-26 21:12:35 +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
Lee Salzman 9ff6a3947e Bug 1750858 - Respect mPicSize in WebRender. r=sotaro
This makes WR properly handle mPicSize when RenderBufferTextureHost is used.
The main change is that we need to take care to pass in display().Size() from
the descriptor, and then further use that to carefully limit the size of the
CbCr texture, as it doesn't necessarily maintain an appropriate half-sized
scale with respect to the Y texture if it is padded.

Given that mPicSize should now actually work, we should no longer need any
of the previous mCroppedSize mechanisms that were added to work around this,
and so they are removed in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D139267
2022-02-22 17:56:30 +00:00