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

2698 Коммитов

Автор SHA1 Сообщение Дата
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
Andrew Osmond 45ae50555d 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 3dbfe82835 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 23a67affe1 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
sotaro a0a0c88a98 Bug 1754388 - Forward more functions in RenderTextureHostWrapper r=gfx-reviewers,aosmond
This is a preparation for Bug 1754330.

Differential Revision: https://phabricator.services.mozilla.com/D138258
2022-02-09 13:44:13 +00:00
Emilio Cobos Álvarez 4a152fdf3e Bug 1746248 - Style system and plumbing for mix-blend-mode: plus-lighter. r=jrmuizel,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D137951
2022-02-09 03:15:52 +00:00
Andi-Bogdan Postelnicu 7858c79fb2 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers
Updated with rustfmt 1.4.38-stable (db9d1b2 2022-01-20)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D137148
2022-01-31 17:00:21 +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
Robert Mader 48aa55faf4 Bug 1752469 - Remove Gnome specific workaround using PauseCompositor(), r=gfx-reviewers,lsalzman
This was originally implemented in D111662 to work around a crash
that otherwise would get triggered in Gnome/Mutter.
The fix for that crash has been available for a couple of month now,
thus remove the workaround again.

This may help preventing flickering for menus in certain situations.

Differential Revision: https://phabricator.services.mozilla.com/D137251
2022-01-28 04:24:16 +00:00
sotaro f9873bede0 Bug 1722447 - Add YUV SwapChain support to hardware decoded video r=gfx-reviewers,nical
Implementation is borrowed from chromium's SwapChainPresenter.

Differential Revision: https://phabricator.services.mozilla.com/D136460
2022-01-26 00:17:37 +00:00
Emilio Cobos Álvarez 88d99f471d Bug 1747409 - Minimal cleanup to WR bindings hit-tester usage. r=gfx-reviewers,kvark
This doesn't change behavior but wrote it drive-by.

Differential Revision: https://phabricator.services.mozilla.com/D136893
2022-01-25 22:02:55 +00:00