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

42019 Коммитов

Автор SHA1 Сообщение Дата
sotaro 1b44e05e92 Bug 1741784 - Remove unused code around CompositableHost r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D131466
2021-11-19 07:41:29 +00:00
sotaro 0601c71c81 Bug 1742017 - include CompositorWidget.h before #ifdef MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING r=gfx-reviewers,jrmuizel
We need to include "mozilla/widget/CompositorWidget.h" before "#ifdef MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING",

Differential Revision: https://phabricator.services.mozilla.com/D131575
2021-11-19 02:44:22 +00:00
Andrew Osmond 25e9161651 Bug 1742010 - File descriptor leak when serializing into SurfaceDescriptorAndroidHardwareBuffer. r=sotaro,gfx-reviewers
We accidently duplicate the file descriptor when serializing because we
hit a constructor for ipc::FileDescriptor which duplicates the handle
instead of just taking it. This means we are supposed to close it
explicitly but we've already forgotten about it. We should just do a
move instead to avoid this.

Differential Revision: https://phabricator.services.mozilla.com/D131569
2021-11-19 02:07:53 +00:00
Brad Werth 5ad125fce1 Bug 1738926 Part 1: Check if sublayers need to be rebuilt. r=mstange
This fixes a correctness issue. Since NativeLayerCA Representations can
generate new CALayers under certain conditions, the NativeLayerRootCA must
check to see if a rebuild is necessary when committing.

Differential Revision: https://phabricator.services.mozilla.com/D131307
2021-11-18 21:28:44 +00:00
sotaro 136d8c49e7 Bug 1741123 - Remove LayersBackend::LAYERS_D3D11 r=gfx-reviewers,bradwerth,nical
Remove LayersBackend::LAYERS_D3D11 is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D131107
2021-11-18 21:27:48 +00:00
Deian Stefan 26994de326 Bug 1738550 - Clean up RLBox type definitions r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D129970
2021-11-18 19:51:08 +00:00
Dzmitry Malyshau 0f3e259c24 Bug 1740165 properly serialize mUseWebGPU r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D131448
2021-11-18 17:13:10 +00:00
Narcis Beleuzu ce6ad351e2 Backed out changeset 12736f9bf7b5 (bug 1741784) for compositor leakchecks. CLOSED TREE 2021-11-18 18:07:09 +02:00
sotaro 2dc3b69cde Bug 1741784 - Remove unused code around CompositableHost r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D131466
2021-11-18 14:16:35 +00:00
sotaro f0775d8818 Bug 1741783 - Rename PuppetWidget::HasLayerManager() to HasWindowRenderer() r=gfx-reviewers,nical
PuppetWidget already renamed GetLayerManager() to GetWindowRenderer().

Differential Revision: https://phabricator.services.mozilla.com/D131465
2021-11-18 14:16:00 +00:00
Jeff Muizelaar 54b2933528 Bug 1741638 - Report error code from Freetype. r=gfx-reviewers,lsalzman
This should give us a better idea of why we're seeing crashes in
bug 1737810.

Differential Revision: https://phabricator.services.mozilla.com/D131379
2021-11-18 03:37:33 +00:00
sotaro 4f3833aa2f Bug 1741111 - Remove LayersBackend::LAYERS_BASIC r=gfx-reviewers,bradwerth
LayersBackend::LAYERS_BASIC is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D131104
2021-11-17 22:05:47 +00:00
Nicolas Silva b9f5b1b3a0 Bug 1741584 - Add a profile event marker for the number of bytes and items uploaded. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D131395
2021-11-17 21:33:55 +00:00
Glenn Watson 6aa0e4bdc9 BUg 1741714 - Validate pipeline ids are not referenced multiple times during scene building r=gfx-reviewers,bradwerth
Add an earlier assert to try and validate the root cause of bug 1736069.

Differential Revision: https://phabricator.services.mozilla.com/D131435
2021-11-17 21:33:37 +00:00
Jeff Gilbert ec09db8181 Bug 1741531 - Print RENDERER in DEBUG builds once per process. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D131314
2021-11-17 19:17:36 +00:00
Alexandru Michis b4ca6a1ac3 Backed out changeset 413c914dd84b (bug 1740675) for causing geckoview failures.
CLOSED TREE
2021-11-17 04:50:58 +02:00
sotaro 8ca63c894d Bug 1740675 - Cleanup device handling around RenderThread r=nical,gfx-reviewers
RenderCompositorANGLE::ShutdownEGLLibraryIfNecessary() is not necessary since Bug 1656034 fix. Device reset handling could be more platform independent.

Differential Revision: https://phabricator.services.mozilla.com/D130960
2021-11-17 01:18:05 +00:00
Emilio Cobos Álvarez 446bae08de Bug 1741495 - Make ThemeDrawsFocusForWidget return the right thing when drawing non-native widgets on Linux and Windows. r=spohl
Noticed this while digging into bug 1741359.

Differential Revision: https://phabricator.services.mozilla.com/D131277
2021-11-17 00:55:26 +00:00
sotaro a125f95885 Bug 1741352 - Relax widget size log in WebRenderLayerManager::Initialize() r=gfx-reviewers,bradwerth
We also want  a size check log in content process.

Differential Revision: https://phabricator.services.mozilla.com/D131210
2021-11-16 22:34:14 +00:00
Brad Werth 1b44cb44ee Bug 1737682 Part 1: Cache calls to NativeLayerCA::ShouldSpecializeVideo in a state bit. r=gfx-reviewers,mstange
This guarantees that any time mMutatedSpecializeVideo is set to true, the next
call to ApplyChanges will receive the value that actually triggered the
mutation. This was *probably* already true, but this change makes it explicit
and similar to other state changes.

Differential Revision: https://phabricator.services.mozilla.com/D129452
2021-11-16 20:55:44 +00:00
Ryan VanderMeulen 5ddde5eb32 Bug 1739248 - Update HarfBuzz to 3.1.1. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D130321
2021-11-16 17:28:53 +00:00
André Bargull 365533a053 Bug 1738422 - Part 4.2: Handle new script codes in GetCommonFallbackFonts. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D130372
2021-11-16 17:02:55 +00:00
sotaro dc41fd6a96 Bug 1740673 - Ensure d3d device re-creation before sessions re-creation in GPUProcessManager::OnInProcessDeviceReset() r=nical,gfx-reviewers
Current code is not explicit about device recreation before session re-creation. It is actually done by nsWindow::OnPaint() before OnInProcessDeviceReset() call. But it is not explicit.

gfxWindowsPlatform::HandleDeviceReset() does d3d device re-creation if it is necessary.

Differential Revision: https://phabricator.services.mozilla.com/D130957
2021-11-16 08:25:09 +00:00
Andi-Bogdan Postelnicu d6be8bb00a Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,firefox-build-system-reviewers,mhentges
Updated with rustfmt 1.4.38-nightly (936238a9 2021-11-11)

Depends on D129119

Differential Revision: https://phabricator.services.mozilla.com/D129120
2021-11-16 08:07:30 +00:00
Andi-Bogdan Postelnicu c8e0f87391 Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg)

Depends on D131114

Differential Revision: https://phabricator.services.mozilla.com/D129119
2021-11-16 08:07:30 +00:00
sotaro f4fdf11ff5 Bug 1738362 - Do not use MacIOSurface for video frame with RenderCompositorSWGL r=bradwerth,gfx-reviewers
RenderCompositorSWGL does not support MacIOSurface NV12 nor YUV422. Their usage causes a crash at SwCompositor::queue_composite(). See Bug 1697004.

On macOS, RenderCompositorSWGL is normally used only for headless.

Differential Revision: https://phabricator.services.mozilla.com/D131040
2021-11-16 01:58:49 +00:00
Tetsuharu Ohzeki 076dabcb2a Bug 1741175 - Remove unused GLBlitTextureImageHelper. r=gfx-reviewers,jgilbert,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D131133
2021-11-16 00:53:16 +00:00
sotaro 096f8e103f Bug 1741121 - LayersBackend::LAYERS_CLIENT r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D131106
2021-11-15 22:39:40 +00:00
Glenn Watson 2ae844f547 Bug 1741114 - Remove tileview debugger r=gfx-reviewers,jrmuizel
Unfortunately this is not currently maintained (it's been broken
since the addition of sub_slice compositor surface support).

It's also complicating efforts underway to refactor the way that
picture cache dependencies are handled as part of the visibility
pass refactoring work.

For these reasons, let's remove this functionality. If we find
someone with time to maintain it in future, it's likely that we
could restore most of the viewer code, and update the picture
cache code in WR to output the appropriate information.

Differential Revision: https://phabricator.services.mozilla.com/D131105
2021-11-15 20:07:40 +00:00
Jamie Nicol 0bf9787775 Bug 1741142 - Don't export ANativeWindow_setBuffersGeometry declaration from wgpu. r=kvark
It conflicts with the NDK header's declaration, causing a build
failure.

Differential Revision: https://phabricator.services.mozilla.com/D131115
2021-11-15 17:21:22 +00:00
Stephen A Pohl 73c5f21015 Bug 1719427: Move scrollbar size information from prefs to C++ and allow sizing to be overridden via prefs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130671
2021-11-15 12:39:39 +00:00
Stephen A Pohl b739277c24 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 12:39:38 +00:00
criss 8ace361058 Backed out 4 changesets (bug 1719427) for causing build bustages. CLOSED TREE
Backed out changeset d6948ef7f495 (bug 1719427)
Backed out changeset 4df7017f6bc9 (bug 1719427)
Backed out changeset 8c5bb08f80e9 (bug 1719427)
Backed out changeset e32004dd2014 (bug 1719427)
2021-11-15 13:46:20 +02:00
Stephen A Pohl 78a1e8621c Bug 1719427: Move scrollbar size information from prefs to C++ and allow sizing to be overridden via prefs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130671
2021-11-15 11:15:56 +00:00
Stephen A Pohl 0468798e53 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 11:15:54 +00:00
sotaro d576be73d8 Bug 1740879 - Remove KnowsCompositor::DeviceCanReset() r=gfx-reviewers,jrmuizel
KnowsCompositor::DeviceCanReset() is not used.

Differential Revision: https://phabricator.services.mozilla.com/D131041
2021-11-12 23:28:05 +00:00
Hiroyuki Ikezoe 7243be3f7a Bug 1692708 - Add scrollTo and scrollTop test cases in helper_relative_scroll_smoothness.html. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D129595
2021-11-12 07:54:18 +00:00
Hiroyuki Ikezoe b11e8dcd33 Bug 1692708 - Transmogrify ScrollToCSSPixels to ScrollByCSSPixels if there's any on-going APZ animation and there's no on-going async scroll by script. r=botond
test_abort_smooth_scroll_by_instant_scroll.html in this comment is a test case
to make sure this change doesn't regress a case where a smoothe scrolling run
by an APZC is replaced by an instant scroll operation by script.

Some other mochitests for this change are in the next commit.

Differential Revision: https://phabricator.services.mozilla.com/D129594
2021-11-12 07:54:17 +00:00
Hiroyuki Ikezoe db5de169ad Bug 1692708 - Add cancelScrollAnimation and use it in window_bug1369072.html and browser_scroll.js. r=botond
Both window_bug1369072.html and browser_scroll.js have a pattern something like;

1) Call synthesizeKey to scroll an element
2) Wait a scroll event
3) Test something
4) (Re)set the scroll position to (0, 0) by calling Element.scrollTop and
   Element.scrollLeft or scrollTo.

With the new transmogrification the step 4) will not reset the scroll position
if there's an on-going scroll animation in APZ triggered by the synthesizeKey.

To avoid the situation where there's an on-going animation at the step 4), we
destroy the corresponding scrollable frame and reconstruct it so that it
clobbers the animation.

Differential Revision: https://phabricator.services.mozilla.com/D130852
2021-11-12 07:54:17 +00:00
Hiroyuki Ikezoe cd625240a9 Bug 1692708 - Run helper_relative_scroll_smoothness.html with native key events both on Windows and Mac. r=botond
synthesizeKey() just invokes a corresponding command. In "KEY_ArrowDown" case
it's nsISelectionController::ScrollLine [1] which is actually
PresShell::ScrollLine which calls nsIScrollable::ScrollBy, that's not what we
wanted to test for bug 1692707. To exercise APZ's keyboard scrolling we need to
use synthesizeNativeKey instead.

[1] https://searchfox.org/mozilla-central/rev/126f016b59513988fae56c2b3f69c1cd23fe6ca1/dom/base/nsGlobalWindowCommands.cpp#363-364

Differential Revision: https://phabricator.services.mozilla.com/D129593
2021-11-12 07:54:17 +00:00
Hiroyuki Ikezoe d547020761 Bug 1692708 - Run helper_relative_scroll_smoothness.html with mouse wheel events. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D129592
2021-11-12 07:54:16 +00:00
Hiroyuki Ikezoe 1b31384027 Bug 1692708 - Specify MOUSESCROLL_SCROLL_LINES in synthesizeNativeWheel if apz.test.mac.synth_wheel_input is true. r=tnikkel
Without specifying the value, even if synthesizeNativeWheel causes wheel inputs,
it will be converted to an instant scroll rather than smooth. In fact on Mac
mouse wheeling causes this type of events that is that the events'
hasPreciseScrollingDeltas flag is false.

Differential Revision: https://phabricator.services.mozilla.com/D129591
2021-11-12 07:54:16 +00:00
Hiroyuki Ikezoe 4dbf08ba04 Bug 1692708 - Await promiseApzFlushedRepaints() before calling window.scrollTo(). r=tnikkel
This is the way what other similar tests do (e.g.
helper_zoomToFocusedInput_multiline.html [1] and
helper_zoomToFocusedInput_scroll.html [2]).


[1] https://searchfox.org/mozilla-central/rev/126f016b59513988fae56c2b3f69c1cd23fe6ca1/gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_multiline.html#35-36
[2] https://searchfox.org/mozilla-central/rev/126f016b59513988fae56c2b3f69c1cd23fe6ca1/gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_scroll.html#33-34

Differential Revision: https://phabricator.services.mozilla.com/D129590
2021-11-12 07:54:16 +00:00
Randell Jesup 7ae4b5ed14 Bug 1740747: Add missing UnlockFTFace() for unlikely case of font removed during init r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D130992
2021-11-11 21:46:31 +00:00
Lee Salzman 3c994f8afd Bug 1739448 - Implement a prototype WebGL-backed Canvas2D. r=gfx-reviewers,nical,jrmuizel
This mainly provides DrawTargetWebgl, which implements the subset of the DrawTarget
API necessary for integration with CanvasRenderingContext2D. It translates them to
suitable commands for its internal ClientWebGLContext, which then manages remoting
WebGL requests to the parent/GPU process.

Currently two shaders are used for drawing Canvas2D primitives, but can be expanded
in the future. These are an image shader and a solid color shader.

The core of this implementation revolves around TexturePacker and TextureHandle,
which cope with the necessity of frequently uploading SourceSurfaces for use with
WebGL. TexturePacker implements a bin-packing algorithm for packing these uploads
into texture pages, which can either be SharedTextures if they are reasonably small,
or StandaloneTextures if they are too big to pack in a SharedTexture. Each upload
is assigned a TextureHandle which is used to manage it in a move-to-front cache,
so that we can easily eject TextureHandles from the back of the cache if we have
too many. These TextureHandles are associated with the SourceSurface that spawned
them to more easily manage their lifetimes.

There are further dependent caches for dealing with blurred shadows and with text.
Shadows are cached in an uploaded texture bound to the SourceSurface that generated
them. Text is handled by caching entire runs in the GlyphCache (keyed by both their
rendering parameters and their glyphs). The text is first rasterized to a surface
and then uploaded to a texture in the GlyphCache which can be reused should the
text be encountered again.

To deal with commands we can't accelerate, a separate internal DrawTargetSkia is
also maintained. The content of the WebGL framebuffer is copied into it so that
drawing can then proceed in software from there. It remains in this fallover state
until the next frame, when it resets back to using the WebGL framebuffer again.

This acceleration is disabled by default. To enable it, you must toggle the pref
"gfx.canvas.accelerated" to true. This should be suitably different from the naming
of the previous SkiaGL prefs to not alias with them. There are a few dependent prefs
that follow from the previous SkiaGL prefs for setting the size limitations for
acceleration and also limitations for the internal texture cache.

Differential Revision: https://phabricator.services.mozilla.com/D130388
2021-11-11 07:16:58 +00:00
Lee Salzman 73ad56c77f Bug 1739448 - Reduce Skia header pollution in Moz2D from sk_sp. r=gfx-reviewers,jgilbert
sk_sp requires its type to be defined at the point of sk_sp declaration.
Just use RefPtr instead which does not have this limitation so we can move
some Skia includes out of the Moz2D headers.

Differential Revision: https://phabricator.services.mozilla.com/D130387
2021-11-11 07:16:57 +00:00
Marian-Vasile Laza 748933bf4b Backed out 2 changesets (bug 1739448) for causing geckoview failures on 1246775-1.html. CLOSED TREE
Backed out changeset 7b82837e2f56 (bug 1739448)
Backed out changeset feac99f1dae3 (bug 1739448)
2021-11-11 07:39:10 +02:00
Lee Salzman c3d10f0f9e Bug 1739448 - Implement a prototype WebGL-backed Canvas2D. r=gfx-reviewers,nical,jrmuizel
This mainly provides DrawTargetWebgl, which implements the subset of the DrawTarget
API necessary for integration with CanvasRenderingContext2D. It translates them to
suitable commands for its internal ClientWebGLContext, which then manages remoting
WebGL requests to the parent/GPU process.

Currently two shaders are used for drawing Canvas2D primitives, but can be expanded
in the future. These are an image shader and a solid color shader.

The core of this implementation revolves around TexturePacker and TextureHandle,
which cope with the necessity of frequently uploading SourceSurfaces for use with
WebGL. TexturePacker implements a bin-packing algorithm for packing these uploads
into texture pages, which can either be SharedTextures if they are reasonably small,
or StandaloneTextures if they are too big to pack in a SharedTexture. Each upload
is assigned a TextureHandle which is used to manage it in a move-to-front cache,
so that we can easily eject TextureHandles from the back of the cache if we have
too many. These TextureHandles are associated with the SourceSurface that spawned
them to more easily manage their lifetimes.

There are further dependent caches for dealing with blurred shadows and with text.
Shadows are cached in an uploaded texture bound to the SourceSurface that generated
them. Text is handled by caching entire runs in the GlyphCache (keyed by both their
rendering parameters and their glyphs). The text is first rasterized to a surface
and then uploaded to a texture in the GlyphCache which can be reused should the
text be encountered again.

To deal with commands we can't accelerate, a separate internal DrawTargetSkia is
also maintained. The content of the WebGL framebuffer is copied into it so that
drawing can then proceed in software from there. It remains in this fallover state
until the next frame, when it resets back to using the WebGL framebuffer again.

This acceleration is disabled by default. To enable it, you must toggle the pref
"gfx.canvas.accelerated" to true. This should be suitably different from the naming
of the previous SkiaGL prefs to not alias with them. There are a few dependent prefs
that follow from the previous SkiaGL prefs for setting the size limitations for
acceleration and also limitations for the internal texture cache.

Differential Revision: https://phabricator.services.mozilla.com/D130388
2021-11-11 04:33:50 +00:00
Lee Salzman b54d5cc42c Bug 1739448 - Reduce Skia header pollution in Moz2D from sk_sp. r=gfx-reviewers,jgilbert
sk_sp requires its type to be defined at the point of sk_sp declaration.
Just use RefPtr instead which does not have this limitation so we can move
some Skia includes out of the Moz2D headers.

Differential Revision: https://phabricator.services.mozilla.com/D130387
2021-11-11 04:33:50 +00:00
Lee Salzman 9bd2203649 Bug 1738589 - Let Gecko decide if WR Mac font has color glyphs. r=jfkthame
WR tries to normalize Mac FontInstances so that regardless of the font color
we only need to generate one version of the glyph in the cache. This strategy
backfires for fonts with color glyphs that are nominally supposed to ignore
the font color, but may choose to opt-in to the font color per-glyph based
on table data.

This determination is problematic to do in WR itself, but Gecko knows whether
a font has color glyphs ahead of time. So we let Gecko pass this data into
ScaledFonts which can then transmit the knowledge of whether the font has
color glyphs to the WR Mac font backend, which will then take appropriate
action.

Differential Revision: https://phabricator.services.mozilla.com/D130819
2021-11-10 22:16:13 +00:00