Commit Graph

41987 Commits

Author SHA1 Message Date
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
Marian-Vasile Laza
a84123836e Backed out changeset fd38093162bc (bug 1738589) for causing reftest failures on svg-glyph-invalid.html. CLOSED TREE 2021-11-10 20:50:54 +02:00
Lee Salzman
233a9f9899 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 16:09:00 +00:00
Jonathan Kew
413d0572e0 Bug 1738700 - Don't use FT_LOAD_COLOR for COLR-format fonts within WebRender, because color-font layers are handled at the Gecko level. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D130271
2021-11-09 23:17:44 +00:00
Jeff Muizelaar
66541b0163 Bug 1740258 - Check if we can open the font when we fail to load it. r=gfx-reviewers,bradwerth
This should help us understand what's going in bug 1737810.

Differential Revision: https://phabricator.services.mozilla.com/D130744
2021-11-09 18:51:21 +00:00
Butkovits Atila
8ef3504c35 Backed out changeset 6e09abd58c15 (bug 1738700) for causing failures at bugs/1738700-1.html. CLOSED TREE 2021-11-09 20:28:50 +02:00
Butkovits Atila
015e2b53f1 Backed out changeset be76cf4f456d (bug 1740258) for causing build bustages complaining about "undeclared type File". CLOSED TREE 2021-11-09 20:25:58 +02:00
Jeff Muizelaar
b58b48555a Bug 1740258 - Check if we can open the font when we fail to load it. r=gfx-reviewers,bradwerth
This should help us understand what's going in bug 1737810.

Differential Revision: https://phabricator.services.mozilla.com/D130744
2021-11-09 17:57:02 +00:00
Andrew Osmond
925d668db0 Bug 1739996 - Select compositor or renderer thread for WebGL OOP depending on threadsafe GL status. r=jgilbert
If GL is threadsafe, we can run on the compositor thread. This appears
to have performance benefits, possibly because the renderer thread is
too busy. If GL is not threadsafe, we must run the WebGL OOP instances
on the renderer thread.

At the time of writing, only the nouveau drivers on Linux are considered
to be not threadsafe, so most users will see WebGL running on the
compositor thread. This patch also adds prefers to override the
blocklist to either assume GL is threadsafe
(webgl.threadsafe-gl.force-enabled) and not threadsafe
(webgl.threadsafe-gl.force-disabled).

Differential Revision: https://phabricator.services.mozilla.com/D130634
2021-11-09 17:33:46 +00:00
Jonathan Kew
6e549f8287 Bug 1738700 - Don't use FT_LOAD_COLOR for COLR-format fonts within WebRender, because color-font layers are handled at the Gecko level. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D130271
2021-11-09 17:06:52 +00:00
Nika Layzell
4bf7ce347c Bug 1732343 - Part 5: Use attached handles for Windows SharedMemory serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126567
2021-11-09 14:17:33 +00:00
Nika Layzell
d73755617d Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-09 14:17:32 +00:00
Michelle Goossens
bd6ee3c71c Bug 1727943 - Re-enable Windows 10 x64 2004 CCov tests that were forgotten r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D130715
2021-11-09 12:55:22 +00:00
Hiroyuki Ikezoe
9816dd2b16 Bug 1739541 - Introduce APZScrollAnimationType and use it in RepaintRequest and ScrollFrameHelopr instead of a boolean representing whether there's an animation or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D130421
2021-11-09 09:19:26 +00:00
Hiroyuki Ikezoe
d858a93e39 Bug 1739541 - Introduce WasTriggeedByScript() function in AsyncPanZoomAnimation class. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D130420
2021-11-09 09:19:26 +00:00
Gerald Squelart
2a8eb1038b Bug 1738627 - profiler_thread_is_being_profiled's ThreadProfilingFeatures is now compulsory - r=canaltinova
Now that most calls to `profiler_thread_is_being_profiled` have been updated, the `ThreadProfilingFeatures` can be made compulsory, to force callers to think about what they really want to know about the current profiling state.

Differential Revision: https://phabricator.services.mozilla.com/D130010
2021-11-08 23:59:36 +00:00
Gerald Squelart
5399574d8b Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Lee Salzman
a34880baf2 Bug 1739567 - Ensure SWGL composite rects have valid i32 sizes. r=gfx-reviewers,aosmond
We represent rects in WR with the Box2D format which uses a (p0, p1) representation.
When evaluating the size of these, the subtraction p1-p0 can potentially overflow the
i32 range, so we need to guard against this. Bug 1730695 consequently allows SWGL
to see much larger transforms than previously, which makes this a possibility.

Differential Revision: https://phabricator.services.mozilla.com/D130562
2021-11-08 07:23:10 +00:00
Gerald Squelart
27166e1256 Bug 1739500 - Modernize lambda that adds a screenshot marker - r=canaltinova
While working on this screenshot marker, I noticed that the lambda initialization could directly copy or move its needed captures, instead of going through separate copies on the stack, which was probably done before C++14 lambda were available to us.

Differential Revision: https://phabricator.services.mozilla.com/D130436
2021-11-07 22:43:12 +00:00
Gerald Squelart
9784494cbd Bug 1739500 - De-duplicate "CompositorScreenshot" marker types - r=canaltinova
There were two structs claiming to be "CompositorScreenshot", which is not allowed. It was working because the JSON output was compatible, and handled in a special way in the front-end.
But it's better to combine the two structs into one, for consistency with other markers, and lower maintainability risks.

Differential Revision: https://phabricator.services.mozilla.com/D130435
2021-11-07 22:43:12 +00:00
sotaro
bf1f700f2b Bug 1739621 - Remove remaining UseAdvancedLayers() r=jrmuizel,gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D130467
2021-11-07 12:44:53 +00:00
sotaro
e13c31b137 Bug 1739553 - Use wr::ExternalImageId in more places r=gfx-reviewers,bradwerth
It could make code more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D130434
2021-11-07 07:26:45 +00:00
Botond Ballo
dac9173b80 Bug 1739663 - Avoid a debug assertion on shutdown in InputQueue::Clear(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D130521
2021-11-07 03:04:14 +00:00
Botond Ballo
977ef592c8 Bug 1739754 - Remove vestiges of class KeyboardScrollAnimation which no longer exists. r=tnikkel
Depends on D130532

Differential Revision: https://phabricator.services.mozilla.com/D130533
2021-11-06 05:21:07 +00:00
Botond Ballo
d1c9489dc6 Bug 1739754 - Fix an out-of-date commment. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D130532
2021-11-06 05:21:07 +00:00
Jeff Muizelaar
1bc2d91d64 Bug 1739551 - Don't bother storing the group bounds. r=mstange
We don't use it for anything anymore.

Differential Revision: https://phabricator.services.mozilla.com/D130432
2021-11-05 20:39:02 +00:00
Jeff Muizelaar
b3adb549de Bug 1739542 - Switch a bunch of IntRects to LayerRects. r=mstange
This makes the coordinate space more obvious. They were IntRects to make it
easier during development to be sloppy.

Differential Revision: https://phabricator.services.mozilla.com/D130423
2021-11-05 20:25:23 +00:00
Cristian Tuns
cbd178830f Backed out 10 changesets (bug 1732343) for causing coverage build bustages (Bug 1739590).
Backed out changeset bba94c79f3e1 (bug 1732343)
Backed out changeset d30fa1e1f605 (bug 1732343)
Backed out changeset ed0b4f757c4b (bug 1732343)
Backed out changeset a272da134c34 (bug 1732343)
Backed out changeset ccb259d73843 (bug 1732343)
Backed out changeset a292990b62de (bug 1732343)
Backed out changeset 7d1854782ca8 (bug 1732343)
Backed out changeset 29eaabd9ffb3 (bug 1732343)
Backed out changeset 1aa26657a7a6 (bug 1732343)
Backed out changeset 7a6708dc620a (bug 1732343)
2021-11-05 07:21:04 -04:00
Cristian Tuns
1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart
ffc00218c3 Bug 1738627 - profiler_thread_is_being_profiled's ThreadProfilingFeatures is now compulsory - r=canaltinova
Now that most calls to `profiler_thread_is_being_profiled` have been updated, the `ThreadProfilingFeatures` can be made compulsory, to force callers to think about what they really want to know about the current profiling state.

Differential Revision: https://phabricator.services.mozilla.com/D130010
2021-11-05 05:52:29 +00:00
Gerald Squelart
7fa084ae7c Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00
Iulian Moraru
04448c5245 Backed out changeset fdfd26e1439d (bug 1738700) for causing reftest failures on 1738700-1.html. CLOSED TREE 2021-11-05 03:20:42 +02:00
Glenn Watson
8af0ab58e4 Bug 1730695 - Fix panic when casting large value to i32 rect r=gfx-reviewers,bradwerth,nical,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128122
2021-11-04 19:44:32 +00:00