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
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
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
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
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
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
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
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
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
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
`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
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
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
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
`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
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
This patch causes us to move WebGL execution in the compositor process
from the Compositor thread to the Renderer thread. This has the
advantage of keeping all of our GL calls on the same thread, which makes
us work more like a typical application. This makes the drivers happy,
especially on Linux, and may allow us to move forward with OOP WebGL on
Linux.
Differential Revision: https://phabricator.services.mozilla.com/D127903
This patch adds the necessary IPDL plumbing to allow us to create WebGL
instances off the main thread in the content process, and to execute
them on the Renderer thread in the compositor process.
Differential Revision: https://phabricator.services.mozilla.com/D127839
The default size on most platforms is 256*256 which corresponds to the default blob tile size. I didn't check on android so I set it to 512*512 above which we never batch the upload so that the behavior is unchanged, but I suspect that a smaller threshold like 256*256 would also work better there.
On Windows with heavy blob image workloads, not batching gives a 20%-30% improvement to the time spent in update_texture_cache.
Differential Revision: https://phabricator.services.mozilla.com/D129516
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event. Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.
If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls. I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.
Differential Revision: https://phabricator.services.mozilla.com/D129781
For tests that actually test margin handling I've just removed the default
margin by adding:
<?xml-stylesheet href="data:text/css,menupopup{margin: 0}" type="text/css"?>
The other tests I've just fixed by accounting for the margins.
Differential Revision: https://phabricator.services.mozilla.com/D129866
In addition to adding locks around the accessors, this also removes the call
to `CommitToScreen` from the fullscreen accessor, which was probably
redundant and definitely made the main thread call `Commit` which introduces
possible concurrency errors.
Differential Revision: https://phabricator.services.mozilla.com/D129425
In this case, the gtest is retained as it makes other assertions
(related to the APZC tree structure) which are useful. However,
it no longer makes hit-testing assertions, and no longer uses
InternalHitTester.
Differential Revision: https://phabricator.services.mozilla.com/D129352
And rename the function to promiseApzFlushedRepaintsInPopup since now the
funciton does the same thing what promiseApzFlushedRepaints does.
Depends on D129365
Differential Revision: https://phabricator.services.mozilla.com/D129366
If we start autoscrolling without moving the mouse position into the content
area, we do sample with undesirable scroll deltas in
AutoscrollAnimation::DoSample since the initial mouse position is outside of the
popup window.
Note that to make sure an event listener mousemove events is set in the popup
content before causing a mousemove event from the browser parent process we need
to add the event listener in the extension's popup context in the first place.
That's because __not awaiting__ a SpecialPowers.spawn() with an addEventListener
call in the spawned context doesn't ensure the script in the spawned context
runs. We will do the same manner for a scroll event in the next change.
Differential Revision: https://phabricator.services.mozilla.com/D129364
When isolating video layers, changes to sublayers that we are already ignoring
should not cause us to change our sublayers. This patch checks to see if the
changes to sublayers can all be safely ignored.
Differential Revision: https://phabricator.services.mozilla.com/D129330
When replaying blob recordings, we need to ensure that we map and unmap
the surface properly so that we don't accidently expire the mapping too
early to free up virtual memory on 32-bit Firefox. The code was written
but not activated because we failed to use the wrong type in the
SourceSurfaceSharedDataWrapper::GetType implementation.
Differential Revision: https://phabricator.services.mozilla.com/D129311
helper_relative_scroll_smoothness.html is basically based on the test case
Markus attached in bug 1692707 comment 0 (which is a really great test case!).
It expands its content and changes the root scroller's scroll position
periodically and causes a 100ms jank every 300ms. In the meantime the parent
process tries to send arrow down key press events so that the helper content is
scrolled by APZ. Without this fix, there will appear same scroll offsets when
the scroll position is changed in the content because it clobbers
previously-sampled scroll offsets, with this fix it won't happen.
Differential Revision: https://phabricator.services.mozilla.com/D128704
The users of this were removed with FrameLayerBuilder.
Two callers that passed true remained: one was a print
statement, and the other should be fine to change.
Differential Revision: https://phabricator.services.mozilla.com/D128946
This test was disabled for webrender because of an assert. The mentioned bug is resolved and doesn't seem to mention this test at all. I pushed to try and it seems to pass now. So let's enable it.
Differential Revision: https://phabricator.services.mozilla.com/D128862