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

2169 Коммитов

Автор SHA1 Сообщение Дата
sotaro 4f1c35bfbd Bug 1669143 - Handle a case that GetDeviceOfEGLDisplay() returned nullptr r=nical
When ANGLE detects device reset, GetDeviceOfEGLDisplay() returns nullptr. It is not handled as device reset in current RenderCompositorANGLE::ShutdownEGLLibraryIfNecessary(). It should be handled as device reset.

Differential Revision: https://phabricator.services.mozilla.com/D92543
2020-10-06 09:31:05 +00:00
Nicolas Silva 1db54669eb Bug 1667696 - Use standard rust channels on Windows. r=jrmuizel
While we measuered somewhat surprisingly high performance improvements on linux when replacing standard channels with crossbeam ones on Linux, there has been a CONTENT_FRAME_TIME regression on Windows around the same time. In doubt, this patch makes us use standard channels on Windows to see if it fixes the regression. This patch will be reverted if it doesn't turn out restore the CONTENT_FRAME_TIME numbers.

Swgl needs to continue using crossbeam because it depends on select which doesn't exist in standard channels.

Differential Revision: https://phabricator.services.mozilla.com/D92383
2020-10-05 14:01:08 +00:00
Solomon Chiu 26f860a4a3 Bug 1667939 - Make the picture tile size configurable via pref. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D91759
2020-10-02 10:38:45 +00:00
Jamie Nicol 7adec85b80 Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 10:23:56 +00:00
Jamie Nicol 5d407f06e0 Bug 1656533 - Handle buffer ages other than 2 for EGL_EXT_buffer_age. r=sotaro,gw
Add a trait PartialPresentCompositor with a function get_buffer_age(),
and allow gecko to pass an implementation to webrender during
initialization. This allows webrender to query the age of the current
backbuffer during compositing.

Make webrender track the previous 2 frame's dirty rects, rather than
just the previous 1 frame's, allowing it to calculate the total damage
rect for buffer ages of up to 3. If the age is greater than 3, treat
the entire buffer as invalid. Also handle special cases of ages 0 and
1, 0 meaning the entire buffer is invalid, and 1 meaning the entire
buffer is valid. Make gecko stop requesting a full render for buffer
ages other than 2, as webrender can now handle these cases itself.

Differential Revision: https://phabricator.services.mozilla.com/D91202
2020-10-02 10:23:49 +00:00
Razvan Maries 63b41aa30f Backed out 3 changesets (bug 1656533, bug 1575765) for WebRender bustages. CLOSED TREE
Backed out changeset 84c31fd9ff82 (bug 1575765)
Backed out changeset 48c1532d1d9d (bug 1575765)
Backed out changeset ed9075d9319b (bug 1656533)
2020-10-02 12:51:55 +03:00
Jamie Nicol 5b8c7d826e Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 08:38:29 +00:00
Jamie Nicol 2bccc84f56 Bug 1656533 - Handle buffer ages other than 2 for EGL_EXT_buffer_age. r=sotaro,gw
Add a trait PartialPresentCompositor with a function get_buffer_age(),
and allow gecko to pass an implementation to webrender during
initialization. This allows webrender to query the age of the current
backbuffer during compositing.

Make webrender track the previous 2 frame's dirty rects, rather than
just the previous 1 frame's, allowing it to calculate the total damage
rect for buffer ages of up to 3. If the age is greater than 3, treat
the entire buffer as invalid. Also handle special cases of ages 0 and
1, 0 meaning the entire buffer is invalid, and 1 meaning the entire
buffer is valid. Make gecko stop requesting a full render for buffer
ages other than 2, as webrender can now handle these cases itself.

Differential Revision: https://phabricator.services.mozilla.com/D91202
2020-10-02 09:04:09 +00:00
Matt Woodrow d01e76fc58 Bug 1668302 - Implement RenderTextureHostSWL for wrapper texture hosts. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D92008
2020-10-01 22:18:52 +00:00
Bogdan Tara 3de7cdb1ac Backed out 2 changesets (bug 1668302) for swr reftest failures CLOSED TREE
Backed out changeset 8434906c98c4 (bug 1668302)
Backed out changeset ea6160902594 (bug 1668302)
2020-10-01 16:06:19 +03:00
Gerald Squelart ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Matt Woodrow dccc13919e Bug 1668302 - Implement RenderTextureHostSWL for wrapper texture hosts. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D92008
2020-10-01 02:56:23 +00:00
Gerald Squelart e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Jamie Nicol d2b7bc3c03 Bug 1640858 - Fix damage region calculation for eglSwapBuffersWithDamage. r=sotaro
Webrender provides dirty rects with a top-left origin, whereas EGL
requires bottom-left. We also clamp the region to the framebuffer size
prior to passing it to EGL. There was a bug in this calculation when
the dirty rect had a negative y-offset and a height greater than the
framebuffer's height. This was causing too little of the screen to be
updated in some circumstances, resulting in stale content.

Note that this is only an issue when
gfx.webrender.max-partial-present-rects != 0.

Differential Revision: https://phabricator.services.mozilla.com/D91714
2020-09-30 12:53:13 +00:00
sotaro 2ba6f43481 Bug 1661371 - Use eglWaitSyncKHR() for andoid fence if possible r=jnicol
For performance, it is better to use eglWaitSyncKHR() for andoid fence if possible.

This change is not used by gecko yet.

Differential Revision: https://phabricator.services.mozilla.com/D89882
2020-09-30 06:45:30 +00:00
sotaro a489219995 Bug 1667927 - Do not close file descriptor of android::Fence if EGLSync is created r=jnicol
When EGLSync is created from fence file descriptor, gecko should not close it. It should be closed by gecko only when EGLSync creation is failed.

Differential Revision: https://phabricator.services.mozilla.com/D91702
2020-09-29 07:32:14 +00:00
Matt Woodrow a1bb0c4f87 Bug 1667919 - Don't crash when calling IsContextLost on a RenderCompositorSWGL. r=jrmuizel
Depends on D91671

Differential Revision: https://phabricator.services.mozilla.com/D91672
2020-09-29 02:20:20 +00:00
sotaro 8a2f3ac45d Bug 1667343 - Skip Video SwapChain present if no video texture update r=nical
Video SwapChain present is not necessary if there is no video texture update.

Differential Revision: https://phabricator.services.mozilla.com/D91404
2020-09-25 14:05:26 +00:00
Kartikaya Gupta aaef0a4678 Bug 1667176 - Miscellaneous unified build fixes. r=mattwoodrow
Upcoming patches shift around which files get unified and expose these build
failures.

Differential Revision: https://phabricator.services.mozilla.com/D91332
2020-09-25 08:57:23 +00:00
Michael Froman 5b942915e9 Bug 1664898 - move media/mtransport to media/transport. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D90309
2020-09-22 21:43:49 +00:00
Sylvestre Ledru fd8b54c40d Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,necko-reviewers,valentin
# ignore-this-changeset

Depends on D90793

Differential Revision: https://phabricator.services.mozilla.com/D90794
2020-09-20 16:09:26 +00:00
Markus Stange bbb8d6b5a2 Bug 1664049 - Allow capturing recorded frames from NativeLayerSnapshotter. r=mattwoodrow
This makes the recording API work in the macOS + WR compositor configuration.

Differential Revision: https://phabricator.services.mozilla.com/D89868
2020-09-18 01:26:32 +00:00
Markus Stange 1772b930c8 Bug 1664049 - Move WebRenderCompositionRecorder functionality into RendererOGL. r=barret
I liked the separation, but having everything in RendererOGL.cpp makes the next patch easier.

One nice effect of this patch is that all the recorder-related wr_renderer_* functions
are now called from the same file. Previously, most of them were called in
WebRenderCompositionRecorder.cpp, but the cleanup function
wr_renderer_release_composition_recorder_structures was called from RendererOGL.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D89867
2020-09-18 01:27:33 +00:00
Markus Stange 5b5bc2d532 Bug 1664049 - Move WebRenderCompositionRecorder into RendererOGL. r=barret
Rather than having two windowID -> [something] hash tables, this reduces it to
one: The renderer is already per-window so we just put the recorder into the
renderer.

Differential Revision: https://phabricator.services.mozilla.com/D89866
2020-09-18 19:32:14 +00:00
Markus Stange 367aa1ab62 Bug 1664049 - Move the creation of the WebRenderCompositionRecorder into RenderThread. r=barret
Differential Revision: https://phabricator.services.mozilla.com/D89865
2020-09-18 01:24:57 +00:00
Kartikaya Gupta 1f997d0f93 Bug 1665501 - Remove unnecessary typedefs. r=mstange
These typedefs seem redundant given the `using` statements in
the webrender_ffi_generated.h header.

Differential Revision: https://phabricator.services.mozilla.com/D90736
2020-09-18 18:31:12 +00:00
Markus Stange 6d2642e09e Bug 1664047 - Only call UpdateSnapshot when ScreenshotGrabber calls GetWindowContents, which it only does if the profiler is running (and Screenshots are enabled). r=mattwoodrow
This requires passing down the window size down in a different way, because the
NativeLayerRootSnapshotter does not know the window size otherwise.

At the same time, this patch also removes WindowNLRS and makes the NativeLayerRoot
implement the profiler_screenshots::Window interface directly.

Differential Revision: https://phabricator.services.mozilla.com/D89864
2020-09-15 20:47:19 +00:00
Markus Stange aa018205e1 Bug 1664135 - Null-check the return value of CreateSnapshotter(). r=mattwoodrow
This can return null when the creation of the GL context for the snapshotter fails, for example.

Differential Revision: https://phabricator.services.mozilla.com/D89863
2020-09-15 14:20:14 +00:00
Jamie Nicol cd32d3d834 Bug 1663732 - Hook up GeckoView's CompositorController.setClearColor() to webrender. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90098
2020-09-15 13:22:24 +00:00
Mihai Alexandru Michis a75aa1f3ed Backed out 2 changesets (bug 1664047, bug 1664135) for causing dt failures in ScreenshotGrabber.cpp
CLOSED TREE

Backed out changeset d8996fcd3568 (bug 1664047)
Backed out changeset 070815d3ff02 (bug 1664135)
2020-09-15 03:09:08 +03:00
Markus Stange b2cdbc6d3e Bug 1664047 - Only call UpdateSnapshot when ScreenshotGrabber calls GetWindowContents, which it only does if the profiler is running (and Screenshots are enabled). r=mattwoodrow
This requires passing down the window size down in a different way, because the
NativeLayerRootSnapshotter does not know the window size otherwise.

At the same time, this patch also removes WindowNLRS and makes the NativeLayerRoot
implement the profiler_screenshots::Window interface directly.

Depends on D89863

Differential Revision: https://phabricator.services.mozilla.com/D89864
2020-09-13 21:41:24 +00:00
Markus Stange fafb77fc27 Bug 1664135 - Null-check the return value of CreateSnapshotter(). r=mattwoodrow
This can return null when the creation of the GL context for the snapshotter fails, for example.

Differential Revision: https://phabricator.services.mozilla.com/D89863
2020-09-13 21:34:50 +00:00
Alexis Beingessner e5dd298d13 Bug 1654807 - update thin-vec to 0.2.1 for potential endianess fix. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87019
2020-09-14 17:32:40 +00:00
Andrew Osmond 64ae7b6168 Bug 1664703 - Expose yet more (round 2) WebRender initializaiton failure error messages to telemetry.
Differential Revision: https://phabricator.services.mozilla.com/D90045
2020-09-13 17:31:14 +00:00
Andrew Osmond a9c24fabba Bug 1664560 - Expose yet more WebRender initialization failure error messages to telemetry. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D89966
2020-09-11 22:40:40 +00:00
Gerald Squelart b0bf2c2172 Bug 1663554 - Convert PROFILER_ADD_TEXT_MARKER and friends to PROFILER_MARKER_TEXT - r=gregtatum
Mostly mechanical changes, with some work needed to convert the different payloads (with optional timestamps, inner window id, and/or backtrace) to the equivalent MarkerOptions.

Differential Revision: https://phabricator.services.mozilla.com/D89587
2020-09-11 00:41:27 +00:00
Nicolas Silva b1c3ab9869 Bug 1662827 - Move the api senders to the webrender crate. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D89387
2020-09-09 12:45:00 +00:00
sotaro 54ede5160d Bug 1460499 - Use DirectComposition for hardware decoded video on Windows r=nical
Use ID3D11VideoProcessor for video frame rendering.

WebRenderError::VIDEO_OVERLAY does not cause disabling WebRender. It just change gfxVars::UseWebRenderDCompVideoOverlayWin() to false.

Differential Revision: https://phabricator.services.mozilla.com/D88763
2020-09-09 01:04:53 +00:00
Mihai Alexandru Michis 002a3217ae Backed out 4 changesets (bug 1662827) for causing webrender bustages.
Backed out changeset 4d216f67247b (bug 1662827)
Backed out changeset 25ef3ef3c69d (bug 1662827)
Backed out changeset 461e4e35a0e3 (bug 1662827)
Backed out changeset 40366bd1a0f7 (bug 1662827)
2020-09-08 17:11:19 +03:00
Nicolas Silva a7e48b6370 Bug 1662827 - Move the api senders to the webrender crate. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D89387
2020-09-08 13:06:16 +00:00
Sylvestre Ledru ba8d39bfb3 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
# ignore-this-changeset

Depends on D89392

Differential Revision: https://phabricator.services.mozilla.com/D89393
2020-09-07 19:57:24 +00:00
Andrew Osmond c45c3ac881 Bug 1662836 - Expose detailed initialization failure reason for WebRender. r=kvark
We don't know why we see initialization failures in the telemetry which
makes it hard to investigate why users aren't getting WebRender and
instead fallback to basic. Let's expose the detailed error message
WebRender already generates and puts in the critical log.

Differential Revision: https://phabricator.services.mozilla.com/D89185
2020-09-08 02:03:26 +00:00
sotaro 64acea96e5 Bug 1658684 - Add android Fence handling to WebRender r=nical
Release fence is delivered from RenderCompositorEGL to WebRenderImageHost via AsyncImagePipelineManager. And the fence is sent to client side by ImageBridgeParent.

Differential Revision: https://phabricator.services.mozilla.com/D88158
2020-09-02 14:21:36 +00:00
Lee Salzman 16b168d133 Bug 1661427 - Allow SWGL SwCompositor to split up compositing work between SwComposite and render threads. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D88392
2020-08-31 18:26:20 +00:00
Sylvestre Ledru 86c0cc26c0 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88714
2020-08-31 06:51:29 +00:00
Razvan Maries b16f595134 Backed out changeset b99610a6833f (bug 1661427) for Talos perma failures. 2020-08-30 21:13:42 +03:00
Lee Salzman d3aa4d7686 Bug 1661427 - Allow SWGL SwCompositor to split up compositing work between SwComposite and render threads. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D88392
2020-08-28 22:27:54 +00:00
Markus Stange 7787074ce9 Bug 1658856 - Fix overdraw and unused tile pixel computation in the profiler markers. r=mattwoodrow
Depends on D86880

Differential Revision: https://phabricator.services.mozilla.com/D86888
2020-08-27 04:01:01 +00:00
Markus Stange 035e844287 Bug 1592031 - Use NativeLayerSnapshotter to capture profiler screenshots with WebRender on macOS. r=mattwoodrow
Depends on D59158

Differential Revision: https://phabricator.services.mozilla.com/D86880
2020-08-27 04:00:57 +00:00