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

59 Коммитов

Автор SHA1 Сообщение Дата
sotaro 0d083ef8b6 Bug 1661197 - Initialize mBufferAge at constructor r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D88246
2020-08-26 10:50:44 +00:00
Robert Mader dd996a396b Bug 1656472 - [X11] Drop CopySubBufferMESA and add SwapBuffersWithDamage support, r=nical
This largely reverts D81868, only keeping what's needed to make SwapBuffersWithDamage
work, and also adds BufferAge support to RenderCompositorOGL.

Differential Revision: https://phabricator.services.mozilla.com/D85565
2020-07-31 16:13:54 +00:00
Nicolas Silva eb34985ecc Bug 1625070 - Use glxCopySubBufferMESA when available if partial present and WebRender are enabled on GLX. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D81868
2020-07-16 14:44:41 +00:00
Narcis Beleuzu 2f4cbd537c Backed out changeset 74a508f9bac4 (bug 1625070) for wr failure on position-sticky-scroll-reposition.html . CLOSED TREE 2020-07-16 13:03:13 +03:00
Nicolas Silva 8f37bf747b Bug 1625070 - Use glxCopySubBufferMESA when available if partial present and WebRender are enabled on GLX. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D81868
2020-07-15 18:20:48 +00:00
Lee Salzman 6221028051 Bug 1646835 - refactor RenderCompositorOGL into RenderCompositorNative. r=mstange
RenderCompositorOGL currently has many responsibilities including supporting
OpenGL compositor for Linux, whole-window compositing for Mac NativeLayerCA,
and per-cache-tile compositing for Mac NativeLayerCA. With the addition of
support for SWGL, this becomes even further complicated.

It becomes advantageous to separate out RenderCompositorOGL specifically as
only the basic OpenGL compositing case, as that naturally yields a simple and
isolated RenderCompositor.

What is left over becomes RenderCompositorNative, a basis for implementing
NativeLayer-based RenderCompositors. To cleanly isolate state and details of
when HW compositing or SW compositing is being used, these are further split
off into RCNativeOGL and RCNativeSWGL versions that deal with specific
isolated details of OpenGL and SWGL respectively.

RCNativeOGL deals with just setting up OpenGL FBOs for NativeLayers.

RCNativeSWGL's new task is just to deal mapping NativeLayers and providing
SWGL FBOs for them without involving OpenGL.

Differential Revision: https://phabricator.services.mozilla.com/D80270
2020-06-23 23:54:24 +00:00
Lee Salzman d879c564d6 Bug 1646835 - add MapTile/UnmapTile hooks to the WR compositor. r=mstange
RenderCompositors for SWGL that wish to provide accelerated compositing need to
subvert the existing Bind/Unbind hooks in the WR compositor. These compositors
need to keep track of their HW tiles without actually binding an OpenGL FBO
for WR to render picture cache tiles. SWGL needs to intervene and get a backing
buffer for tile from the RenderCompositor so that it can create a SWGL FBO for
WR to render the picture cache tile to.

To that end, this adds MapTile/UnmapTile as a replacement for Bind/Unbind for
those scenarios. This is done in a way that it affects only the WrCompositor of
webrender_bindings without actually altering WR's Compositor interface. This is
beneficial because WR does not have to understand the details of SWGL
integration and also so as not to complicate other users of WR such as Servo
who are not currently utilizing SWGL at all.

RenderCompositorOGL is initially modified to use these hooks in this patch. It
later became more convenient to restructure that in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D80269
2020-06-23 23:55:11 +00:00
Markus Stange 4c8b889f5e Bug 1646066 - Make partial valid rects work properly in NativeLayerCA. r=jrmuizel
This moves the clipping responsibility into the layer. It also brings back
assertions that make sure that no invalid content reaches the screen.
On the layer side I'm renaming validRect to displayRect, because at the time
NextSurface* is called, that rect is not yet valid.
This implementation also allows having valid content outside of the display
rect. So, for example, if you grow and shrink the display rect multiple times
but most of the outer parts are transparent, in theory this allows you to paint
the transparent pixels only once rather than every time the display rect
expands.

Differential Revision: https://phabricator.services.mozilla.com/D79842
2020-06-18 22:15:22 +00:00
sotaro d117745eaf Bug 1633303 - Add glDebugCallback support to non shared gl context with WebRender r=gw
Bug 1632096 added the capability to shared gl context with WebRender. This bug extends the support to non shared gl context.

Differential Revision: https://phabricator.services.mozilla.com/D72579
2020-04-27 02:51:48 +00:00
Glenn Watson 8efc792cc9 Bug 1620147 - Fix virtual surface coords being outside bounds. r=Bert,sotaro
This adds support for tracking and invalidating tiles based on a
movable virtual offset.

Differential Revision: https://phabricator.services.mozilla.com/D65687

--HG--
extra : moz-landing-system : lando
2020-03-10 02:17:35 +00:00
Emilio Cobos Álvarez d18caaa054 Bug 1616395 - Remove FfiVec. r=jrmuizel
Use ThinVec instead, which is compatible with nsTArray, and makes stuff much
harder to misuse.

Differential Revision: https://phabricator.services.mozilla.com/D63256

--HG--
extra : moz-landing-system : lando
2020-02-19 18:34:51 +00:00
Glenn Watson 31585fc1e6 Bug 1608717 - Support per-tile clip (valid) region for native compositor implementations. r=sotaro,mstange
For Draw (non-native) and CA modes, we include the per-tile
valid rect in the clip rect from the surface.

For DC (non-virtual) mode, a per-tile clip rect is set on the
visual for each tile, separate from the overall clip rect that
is set on the surface visual.

For DC (virtual) mode, the Trim API is used to remove pixels
in the virtual tile area that are outside the valid / clipped
region.

Note: Although the valid rect is now applied in the native
compositors, it's currently only based on the overall picture
cache bounding rect. Thus, with this patch there isn't any
noticeable performance improvement. Once this lands and is
working correctly, the follow up patch to calculate a smaller
valid region per-tile is a small amount of work.

Differential Revision: https://phabricator.services.mozilla.com/D61424

--HG--
extra : moz-landing-system : lando
2020-02-12 04:27:15 +00:00
Markus Stange c65601d463 Bug 1606608 - Fix mTotalPixelCount bug and do some cleanup. r=gw
This fixes RenderCompositorOGL::DestroySurface to update mTotalPixelCount as needed when there are still tiles in the surface that's getting removed.

I'm also adding a few asserts and performing some minor cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D58518

--HG--
extra : moz-landing-system : lando
2020-01-08 16:30:18 +00:00
Glenn Watson 3aa1137e6f Bug 1604684 - Make opacity a compositor surface property rather than a tile property. r=sotaro
This will allow use of the DirectComposition virtual surface API. If
it turns out that some pages recreate surfaces a lot due to opacity
changing, we can add some extra logic to avoid recreating surfaces
as often, and making use of per-tile opacity in some cases.

Differential Revision: https://phabricator.services.mozilla.com/D57592

--HG--
extra : moz-landing-system : lando
2020-01-06 20:11:21 +00:00
Markus Stange 056c822645 Bug 1592026 - When using the OS compositor with WebRender on macOS, use NativeLayerRootSnapshotter for reftest readback. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D57070

--HG--
extra : moz-landing-system : lando
2019-12-29 12:41:58 +00:00
Markus Stange 239125933c Bug 1592026 - Move NativeLayerRoot::CommitToScreen call from PostRender into the compositors. r=jrmuizel
This makes it more similar to how SwapBuffers was used.
This patch also makes us call glFlush directly when using native layers, rather than going through the misleadingly-named GLContext::SwapBuffers method.

Differential Revision: https://phabricator.services.mozilla.com/D57062

--HG--
extra : moz-landing-system : lando
2019-12-29 12:41:04 +00:00
Markus Stange 0f70058b6f Bug 1592044 - Reduce the frequency of IOSurface and framebuffer creation and destruction with the help of a surface pool. r=jgilbert
There are multiple SurfacePools: Main thread painting and the non-WebRender compositors create a new pool per window, and WebRender creates one shared pool across all windows. The non-WebRender users set the pool size limit to zero, i.e. no recycling across paints. This preserves the pre-existing behavior.
WebRender's pool size is configurable with the gfx.webrender.compositor.surface-pool-size pref.
Every window holds on to a SurfacePoolHandle. A SurfacePoolHandle has an owning reference to the pool, via a surface pool wrapper. Once all handles are gone, the surface pool goes away, too.
The SurfacePool holds on to IOSurfaces and MozFramebuffers. Both are created on demand, independently, but are associated with each other.
A given NativeLayer uses only one surface pool handle during its lifetime. The native layer no longer influences which GLContext its framebuffers are created for; the GL context is now managed by the surface pool handle.
As a result, a NativeLayer can no longer change which GLContext its framebuffers are created by.
So in the future, if we ever need to migrate a window frome one GLContext to another, we will need to recreate the NativeLayers inside it. I think that's ok.

Differential Revision: https://phabricator.services.mozilla.com/D54859

--HG--
extra : moz-landing-system : lando
2019-12-18 21:01:51 +00:00
Glenn Watson 3aeeba2db2 Bug 1604383 - Refactor the Compositor trait to allow support for DC virtual surface API. r=mstange,sotaro
Differential Revision: https://phabricator.services.mozilla.com/D57415

--HG--
extra : moz-landing-system : lando
2019-12-17 21:44:03 +00:00
sotaro c61720a7d0 Bug 1603676 - Move picture caching check for WR compositor to Feature::WEBRENDER_COMPOSITOR check r=gw
about:support could have an information that WR compositor is disabled by disabling picture caching.

Differential Revision: https://phabricator.services.mozilla.com/D57266

--HG--
extra : moz-landing-system : lando
2019-12-16 03:50:31 +00:00
Glenn Watson 2a3fc4613c Bug 1603207 - Only enable native compositor if picture caching enabled. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D56817

--HG--
extra : moz-landing-system : lando
2019-12-12 00:08:38 +00:00
sotaro 111038667c Bug 1602511 - Blacklist webrender compositor on Intel HD 520 r=gw
Differential Revision: https://phabricator.services.mozilla.com/D56535

--HG--
extra : moz-landing-system : lando
2019-12-10 19:16:13 +00:00
Markus Stange cf6c4692db Bug 1599609 - Add mTotalPixelCount to get accurate memory usage reporting in WR OS comppositor profiler markers. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D54857

--HG--
extra : moz-landing-system : lando
2019-11-27 23:07:26 +00:00
Markus Stange 720bec5704 Bug 1599609 - Change printf to a profiler text marker. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D54856

--HG--
extra : moz-landing-system : lando
2019-11-27 23:07:51 +00:00
Markus Stange e5db20bdde Bug 1599605 - Crash when DestroySurface is called with an unknown ID. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D54854

--HG--
extra : moz-landing-system : lando
2019-11-27 02:38:49 +00:00
Markus Stange d72f22d80a Bug 1449205 - Share OpenGL contexts between WebRender windows on macOS. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D53121

--HG--
extra : moz-landing-system : lando
2019-11-19 17:46:39 +00:00
Markus Stange a1a4d63983 Bug 1592150 - Enable support for partial updates in the WebRender OS compositor on macOS. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D51762

--HG--
extra : moz-landing-system : lando
2019-11-19 03:33:43 +00:00
Markus Stange 8b245c092f Bug 1576390 - Remove the prefs gfx.core-animation.enabled and gfx.compositor.glcontext.opaque, and all the code needed to support it. r=mattwoodrow,spohl
Differential Revision: https://phabricator.services.mozilla.com/D52739

--HG--
extra : moz-landing-system : lando
2019-11-13 19:07:37 +00:00
Markus Stange ba013d0f42 Bug 1594950 - Change NextSurface APIs to accept a dirty region, and remove the public method InvalidateRegionThroughoutSwapchain. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D50878

--HG--
extra : moz-landing-system : lando
2019-11-13 18:55:18 +00:00
Markus Stange 80c235777f Bug 1594950 - Bake the layer size and its opaqueness into the layer, don't allow mutating it. r=jrmuizel
These settings are now supplied during layer creation and never change.
Consumers must now create new NativeLayer objects if they want to change size or toggle opaqueness.
This aligns the NativeLayer API with DirectComposition's capabilities. It also simplifies swap chain
management.

Differential Revision: https://phabricator.services.mozilla.com/D51757

--HG--
extra : moz-landing-system : lando
2019-11-13 18:46:02 +00:00
Cosmin Sabou 1d71e9f510 Backed out 4 changesets (bug 1594950) for turning bug 1405083 into permafail.
Backed out changeset 684a87e91d94 (bug 1594950)
Backed out changeset adea6912c3a3 (bug 1594950)
Backed out changeset aea7108204e9 (bug 1594950)
Backed out changeset 15baea8520de (bug 1594950)
2019-11-13 06:44:24 +02:00
Markus Stange 2db4b324b7 Bug 1594950 - Change NextSurface APIs to accept a dirty region, and remove the public method InvalidateRegionThroughoutSwapchain. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D50878

--HG--
extra : moz-landing-system : lando
2019-11-12 19:50:26 +00:00
Markus Stange 82452d888a Bug 1594950 - Bake the layer size and its opaqueness into the layer, don't allow mutating it. r=jrmuizel
These settings are now supplied during layer creation and never change.
Consumers must now create new NativeLayer objects if they want to change size or toggle opaqueness.
This aligns the NativeLayer API with DirectComposition's capabilities. It also simplifies swap chain
management.

Differential Revision: https://phabricator.services.mozilla.com/D51757

--HG--
extra : moz-landing-system : lando
2019-11-12 19:50:25 +00:00
Bob Owen 32869c5f76 Bug 1589718: Add a RenderedFrameId to RenderCompositor and use it to control release of textures. r=sotaro
This replaces mUpdatesCount in AsyncImagePipelineManager, which was really how
many times NotifyPipelinesUpdated was called with aRender == true. I think this
makes the release logic clearer as it is more explicit.
It also changes things for RenderCompositorANGLE, so that we check to see if
any other frames have completed even if we don't want to wait for them.

Differential Revision: https://phabricator.services.mozilla.com/D51064

--HG--
extra : moz-landing-system : lando
2019-11-04 16:15:20 +00:00
sotaro 34a65d16bb Bug 1575159 - Implement partial invalidation on Windows r=gw
Partial present for WR is off by default.

Differential Revision: https://phabricator.services.mozilla.com/D51358

--HG--
extra : moz-landing-system : lando
2019-11-03 10:57:03 +00:00
Glenn Watson 0c98790154 Bug 1591627 - Add support for specifying surface opacity to OS compositor interface. r=mstange,kvark
Differential Revision: https://phabricator.services.mozilla.com/D51033

--HG--
extra : moz-landing-system : lando
2019-10-30 20:49:44 +00:00
Markus Stange a928e461d8 Bug 1591523 - First pass of OS compositor implementation on macOS. r=sotaro
This implementation is off by default (behind gfx.webrender.compositor) until
various bugs and inefficiencies are fixed. See bug 1592016.

Differential Revision: https://phabricator.services.mozilla.com/D50726

--HG--
extra : moz-landing-system : lando
2019-10-29 20:54:09 +00:00
Markus Stange f2c9430255 Bug 1591523 - Move existing NativeLayer management into RenderCompositorOGL. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D50724

--HG--
extra : moz-landing-system : lando
2019-10-29 20:50:33 +00:00
Bogdan Tara f866fef3ad Backed out 3 changesets (bug 1591523) for bustages complaining about RenderCompositorOGL.cpp CLOSED TREE
Backed out changeset 407f051e14db (bug 1591523)
Backed out changeset b4c8080dae86 (bug 1591523)
Backed out changeset abb627bc4f75 (bug 1591523)
2019-10-29 22:00:05 +02:00
Markus Stange 9585925ff5 Bug 1591523 - First pass of OS compositor implementation on macOS. r=sotaro
This implementation is off by default (behind gfx.webrender.compositor) until
various bugs and inefficiencies are fixed. See bug 1592016.

Differential Revision: https://phabricator.services.mozilla.com/D50726

--HG--
extra : moz-landing-system : lando
2019-10-29 19:25:39 +00:00
Markus Stange 4631463725 Bug 1591523 - Move existing NativeLayer management into RenderCompositorOGL. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D50724

--HG--
extra : moz-landing-system : lando
2019-10-29 19:25:29 +00:00
Markus Stange 85f866aad1 Bug 1578099 - Use NativeLayer::NextSurfaceAsFramebuffer for WebRender. r=mattwoodrow
Depends on D44325

Differential Revision: https://phabricator.services.mozilla.com/D44326

--HG--
extra : moz-landing-system : lando
2019-09-01 22:36:00 +00:00
Markus Stange e0e54098e9 Bug 1574592 - Move NativeLayer management out of nsChildView and into LayerManagerComposite and RendererOGL. r=mattwoodrow
It looks like a big patch but it's mostly just moved code, with some duplication:
 - Layer creation and destruction moves to LayerManagerComposite and RendererOGL.
 - BasicCompositor IOSurface setup code moves to BasicCompositor.cpp.
 - OpenGL IOSurface setup code moves to CompositorOGL and RenderCompositorOGL.

The duplication is a bit unfortunate but the LayerManagerComposite code will
diverge from the WebRender code soon.

BeginFrame gets a new argument aNativeLayer. This argument will go away again
over the course of this patch queue. But for now, BeginFrame is the best place
to do the layer setup because it's a very close place to PreRender which is
where that code was previously.

I wasn't able to think of a nice way to give CompositorOGL and BasicCompositor
platform-specific behavior without #ifdefs. So now LayerManagerComposite uses
the "cross-platform" NativeLayer interface, but CompositorOGL and
BasicCompositor use NativeLayerCA because they actually need the IOSurface, and
they do that in #ifdef'd code.
Luckily, NativeLayerCA.h can be included in both .cpp files and in .mm files.

Differential Revision: https://phabricator.services.mozilla.com/D42402

--HG--
extra : moz-landing-system : lando
2019-08-25 17:43:42 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Nicholas Nethercote 7974362afd Bug 1567329 - Append `_AtStartup` to `once` static pref getters. r=erahm
Currently it's completely unclear at use sites that the getters for `once`
static prefs return the pref value from startup, rather than the current pref
value. (Bugs have been caused by this.) This commit improves things by changing
the getter name to make it clear that the pref value obtained is from startup.

This required changing things within libpref so it distinguishes between the
"base id" (`foo_bar`) and the "full id" (`foo_bar` or
`foo_bar_DoNotUseDirectly` or `foo_bar_AtStartup` or
`foo_bar_AtStartup_DoNotUseDirectly`; the name used depends on the `mirror` and
`do_not_use_directly` values in the YAML definition.) The "full id" is used in
most places, while the "base id" is used for the `GetPrefName_*` and
`GetPrefDefault_*` functions.

(This is a nice demonstration of the benefits of the YAML file, BTW. Making
this change with the old code would have involved adding an entry to every
single pref in StaticPrefList.h.)

The patch also rejigs the comment at the top of StaticPrefList.yaml, to clarify
some things.

Differential Revision: https://phabricator.services.mozilla.com/D38604

--HG--
extra : moz-landing-system : lando
2019-07-22 02:10:14 +00:00
Markus Stange daf06d791b Bug 1565668 - Add back-pressure to WebRender+OGL by implementing RenderCompositorOGL::WaitForGPU(). r=sotaro
Without CoreAnimation, back-pressure was applied by SwapBuffers: On a
double-buffered NSOpenGLContext which is bound to an NSView, [context flushBuffer]
waits for the previous frame to be finished. With CoreAnimation, the context
is no longer bound to an NSView, and SwapBuffers acts as a regular glFlush.
glFlush on its own does not prevent overproduction.

If we submit GPU work at a faster rate than the GPU can handle, we end up
delaying the window server's GPU work. This can cause the window server to skip
frames. So even if Gecko can produce frames at 60FPS, the window server might
only present those frames at 30FPS, skipping every second frame.

Differential Revision: https://phabricator.services.mozilla.com/D26412

--HG--
extra : moz-landing-system : lando
2019-07-17 20:46:39 +00:00
Markus Stange 51a3779fea Bug 1565668 - Make WebRender draw into the default framebuffer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D26624

--HG--
extra : moz-landing-system : lando
2019-07-17 20:45:54 +00:00
sotaro f8e55ff471 Bug 1563432 - Remove ID3D11Device::GetDeviceRemovedReason() call from RenderCompositorANGLE::BeginFrame() r=nical
Differential Revision: https://phabricator.services.mozilla.com/D36866

--HG--
extra : moz-landing-system : lando
2019-07-11 09:41:38 +00:00
sotaro 6510aded8d Bug 1539729 - Disable RenderCompositorOGL usage on android r=nical
On android, we want to use only RenderCompositorEGL for using sharedGL. Further RenderCompositorOGL does not work well with android SurfaceTexture.

Differential Revision: https://phabricator.services.mozilla.com/D25201

--HG--
extra : moz-landing-system : lando
2019-04-01 21:58:05 +00:00
sotaro 2c65d7229c Bug 1532949 - Bug 1532024 - Explicityly create headless context for webrender in RenderCompositorEGL r=jgilbert
On Wayland with WebRender, RenderCompositorEGL creates headless context by using GLContextProviderEGL::CreateForCompositorWidget(), since GetNativeData(NS_NATIVE_EGL_WINDOW) returns nullptr. But we want to make hadless explicitly. But GLContextProviderEGL::CreateHeadless() and GLContextEGL::CreateEGLPBufferOffscreenContext() could not be used for it. They creates incompatible EGLConfig to egl window. Then we extends GLContextProviderEAGL::CreateForCompositorWidget() to handle this case. When CreateForCompositorWidget() receives null widget, it creates GLContext without surface of egl window.

Differential Revision: https://phabricator.services.mozilla.com/D22454

--HG--
extra : moz-landing-system : lando
2019-03-13 00:17:01 +00:00
Ryan Hunt 85ff4bdc33 Bug 1523969 part 8 - Move method definition inline comments to new line in 'gfx/'. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D21108

--HG--
extra : rebase_source : 48a4586f507891f3a2f0f970e9b9a0b15f0f3d61
2019-02-25 16:07:19 -06:00