* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
Using `SimpleTest.is` directly instead of the "global" `is` installed by
runSubtestsSeriallyInFreshWindows means that the helper test filename doesn't
get emitted in the assertions, which is a nice thing to have. (Ditto for `ok`
and friends).
Problematic tests identified using:
for helper in helper_*.html; do
if [[ $(grep "$helper" test_group*) ]]; then
echo $helper;
grep -e 'SimpleTest.\(is\|ok\)' "$helper";
fi;
done
While it would be nice to catch this sort of thing directly in the code, it's
a bit tricky to do because SimpleTest.(ok|is) do get used legitimately by helper
methods that are used by group subtests and top-level tests.
Depends on D79171
Differential Revision: https://phabricator.services.mozilla.com/D79172
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
to propagate
* Mortgage/strip out more OffscreenCanvas code for now
Differential Revision: https://phabricator.services.mozilla.com/D75055
This uses "None" instead of "NotSpecified" as the value for
mLastSmoothScrollOrigin when there is no smooth scroll in progress.
Depends on D78439
Differential Revision: https://phabricator.services.mozilla.com/D78469
This patch is a fairly mechanical conversion. The old `nullptr` gets converted
to ScrollOrigin::NotSpecified, and all the other possible values get corresponding
values in the new ScrollOrigin enum. A few switch statements are introduced to
clean up big if statements, but other than that, additional cleanups will happen
in later patches.
Differential Revision: https://phabricator.services.mozilla.com/D78438
When DWM is disabled, each window does not have own back buffer. They would paint directly to a buffer that was to be displayed by the video card. WM_PAINT via SendInvalidRegion() requests necessary re-paint. With it, RenderCompositorANGLE does not need to disable partial present.
Differential Revision: https://phabricator.services.mozilla.com/D77989
WR font sanitization appears relatively stable now, and we passed the 79
cutoff, so let WR font sanitization ride the trains.
Differential Revision: https://phabricator.services.mozilla.com/D78147
Previously, we would wait until the following frame (for uncertain reasons
that date back to B2G), but this meant the layout and visual viewports would
be out of sync for a frame, causing APZ to misbehave.
Differential Revision: https://phabricator.services.mozilla.com/D61286
Activating pinch locking means we are locked into a two-finger pan
(no scaling), which can trigger a fling animation at the end. We
track velocity via UpdateWithTouchAtDevicePoint() while pinch locked.
We need to call StartTouch() when we start tracking velocity.
Differential Revision: https://phabricator.services.mozilla.com/D77980
Adds an |aChromeOnlyDispatch| flag to DispatchCustomEvent to decide whether
to call DispatchTrustEvent or DispatchEventOnlyToChrome.
The following chrome-only events are dispatched with DispatchCustomEvent and now
make use of the flag:
- DOMWindowClose
- fullscreen / willenterfullscreen / willexitfullscreen
- occlusionstatechange
- resolutionchange
- XULAlertClose
and the following were previously dispatched with DispatchTrustedEvent and now
use DispatchEventOnlyToChrome:
- MozBeforeInitialXULLayout
- MozMouseScrollFailed / MozMouseScrollTransactionTimeout
- MozPaintWait / MozPaintWaitFinished
- MozPerformDelayedBlur
- all events fired by APZCCallbackHelper::NotifyMozMouseScrollEvent
Differential Revision: https://phabricator.services.mozilla.com/D76723
Bug 1635406 made it so that webrender snaps the offsets of animated
transforms before accumulating them in to the reference frame
transform. Unfortunately, however, this causes jittery animations. The
original intention was just to snap the visual viewport offset when
scrolling, to avoid excessive picture cache invalidation.
To avoid this, make it so that we only snap for reference frames of
kind ReferenceFrameKind::Zoom. This will mean that most animations are
unaffected. There may however still be some jitter when zooming, but
this is outweighed by the benefit of not invalidating picture cache
tiles every frame when scrolling.
Differential Revision: https://phabricator.services.mozilla.com/D77679
VAAPIFrameHolder was moved to FFmpegVideoDecoder class and we use WaylandDMABufSurface global lock to keep
surface reference until it's used.
Differential Revision: https://phabricator.services.mozilla.com/D76691
This patch implements:
- Global surface UID for better tracking/debugging. The UID is passes acros all processes so we can track
surface usage.
- WaylandAllocateShmMemory() function which uses shm_open() instead of files at tmp for Shm memory creation.
- DMABufRefcount() class based on eventfd() which is used as a global surface reference count.
Differential Revision: https://phabricator.services.mozilla.com/D76689
This is specifically needed because the new test I'm adding uses both
pinchZoomInWithTouch and forceLayerTreeToCompositor, and it seems hard/impossible
to make that work unless both are async functions or both are non-async generator
functions. And in general I think we want to move away from the generator-style
tests and towards async-style tests as they are cleaner and more flexible. So
this migrates helper_basic_zoom along with turning pinchZoomInWithTouch into
an async function.
Depends on D76813
Differential Revision: https://phabricator.services.mozilla.com/D76814
This is the main fix for the bug. When APZ is getting metrics from the main
thread "for the first time" it should accept the visual scroll offset in the
main thread metrics. Normally one would expect the isFirstPaint flag to be
set on this call to NotifyLayersUpdated, but that seems to only ever be set
on the very first paint of a presShell. In particular it is not set after a
tabswitch because the brower's async tab switching mechanism means that the
layer tree is already cached in the compositor.
Differential Revision: https://phabricator.services.mozilla.com/D76812
SetScrollableFrameMetrics uses a bogus scrollable rect (-1, -1, -1, -1) if none
is provided. With the next patch, we start using this bogus rect for clamping
the scroll offset on some calls to NotifyLayersUpdated, and causes the gtest
to fail. If we provide some sane rect it all works fine.
Depends on D76810
Differential Revision: https://phabricator.services.mozilla.com/D76811
Bug 1620014 attempted to fix an issue where an animated visual
viewport offset (eg due to scrolling while being zoomed in) was
causing the fractional offset of a descendant scroll frame's content
transform to change, causing too much picture cache invalidation.
It did so by snapping the coordinate-system-relative offset when using
it to calculate the content_transform. This value of course includes
the animated visual viewport offset (as the axis-aligned zoom
transform cannot reset the coordinate system). However, it also
includes non-animated offsets, which were now being incorrectly
snapped, causing blurry/clipped text.
This change reverts that original fix. And instead, it snaps the
source_transform of the reference frame itself when it is sampled,
rather than the accumulated coordinate-system-relative scale_offset of
the scroll frame. Additionally, it only snaps the offset if it is an
animation (including zoom), and static offsets are left unsnapped.
Differential Revision: https://phabricator.services.mozilla.com/D76298
We've already tried to looking up the existing AnimatedValue so that when we
want to replace the old one in the hash table we can reuse the existing one.
With this manner, we no longer need to copy TransformData if we don't need to
do.
Differential Revision: https://phabricator.services.mozilla.com/D76633
With current gecko, there are cases that compositor window is used even when it is not necessary. For example, fallback from DirectComposite with WebRender and fallback from double buffering with Compositor. With some gpu drivers, the fallbacks with compositor window causes rendering problem.
Differential Revision: https://phabricator.services.mozilla.com/D76470
In favor of the NativeAnonymous versions which they forward to.
Done automatically with:
rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'
And removing the function definitions afterwards.
Differential Revision: https://phabricator.services.mozilla.com/D76681
The scroll position and scrollable rect are inside the zoom boundary so we need to use the composisted size inside the zoom boundary as well.
Differential Revision: https://phabricator.services.mozilla.com/D76089
WR may be sanitizing more fonts than just downloadable webfonts (any for
which we couldn't generate a descriptor), so we need to be more permissive
about what font types we allow that the content process would normally skip.
Differential Revision: https://phabricator.services.mozilla.com/D76608
By using RenderTextureHostWrapper, we could reduce re-creation of RenderDXGITextureHostOGL and RenderDXGIYCbCrTextureHostOGL.
Differential Revision: https://phabricator.services.mozilla.com/D74838
This makes it more obvious that we are using the same scrollDelta for adjusting
the displayport as we are for populating the callback transform. Instead of
computing the same value inside a helper, we just provide the helper with the
already-computed delta that is used for the callback transform too.
Differential Revision: https://phabricator.services.mozilla.com/D76297
In StackingContextHelper::StackingContextHelper we want to handle the case of "no passed in transform" differently from "passed in transform but it cannot be drawn 2d". This is a little tricky because ChooseScale always has a transform passed in: in the non-wr case it is a scaling matrix by the parent scale. We could call ChooseScale if canDraw2D is false and get the same value for mScale but we also need to keep mInheritedTransform in sync.
This issue arose before: https://bugzilla.mozilla.org/show_bug.cgi?id=1449958#c3
And we want to be careful not to regress that bug, that bug was concerning content without a transform, so we should be good.
The testcase has a parent element with rotateY(-80deg) and a child element with rotateY(80deg), the combined transform is flat with no scaling even though each transform individually would have a very small x scale. There's no way to choose a good scale by looking at each transform individually, and since we only currently store transforms as 2d matrices we can't look at the full combined transform in order to choose a scale. Thus we must use a unit scale, like ChooseScale does.
Differential Revision: https://phabricator.services.mozilla.com/D75289
The lock we added in `GetPendingScrollPayload` and
`RemovePendingScrollPayload` are released at the end of the function,
not at when we finish using the underlying data, thus we may still
end up recording a payload that has been deleted.
To fix this, we introduce a new method to move the data from the
hashtable into the array argument while the lock is held, then the
caller can iterate over the array safely.
Differential Revision: https://phabricator.services.mozilla.com/D76052
Instead of accepting a `UniquePtr<ProfilerMarkerPayload>`, `profiler_add_marker_for_thread` now takes it by `const ProfilerMarkerPayload&`.
All callers can now create the payload on the stack, or as a temporary object. This saves a memory alloc+free for each call.
Differential Revision: https://phabricator.services.mozilla.com/D75912
RenderTextureHost is destroyed in WebRenderTextureHost::~WebRenderTextureHost() on current gecko. But It is better to destroy it by TextureHost that created the RenderTextureHost. GPUVideoTextureHost is an exception for now.
Differential Revision: https://phabricator.services.mozilla.com/D75255
RenderTextureHost is destroyed in WebRenderTextureHost::~WebRenderTextureHost() on current gecko. But It is better to destroy it by TextureHost that created the RenderTextureHost. GPUVideoTextureHost is an exception for now.
And it is a preparation for Bug 1636868.
Differential Revision: https://phabricator.services.mozilla.com/D75255
The patch also removes the ignoreRootScrollFrame option from
APZCCallbackHelper::DispatchMouseEvent() altogether as it is
no longer used.
Depends on D75735
Differential Revision: https://phabricator.services.mozilla.com/D75736
This patch will do :
- add a graphic label in `ImageContainer::SetCurrentImages()`
The advantage of doing so :
- to mark following profiling frames as graphic, so we can know the time of spending on graphic and media respectively
Differential Revision: https://phabricator.services.mozilla.com/D74173
When android SurfaceTexture is rendered to WebGL, the SurfaceTexture should not be attached to GL context of WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D66367
Part 1 of this patch enables subpixel AA in more cases when there
are multiple picture cache slices. Because of this, we can enable
extra picture cache slices by default, as a performance win for
the general case.
Users who want to force subpixel AA in more cases, at the cost of
performance can manually set the about:config value called
gfx.webrender.quality.force-subpixel-aa-where-possible.
Differential Revision: https://phabricator.services.mozilla.com/D75465
In this bug we're moving away from monolithic JNI headers to class-specific
headers so that we don't have to rebuild the world every time we make a change
to a JNI interface.
Differential Revision: https://phabricator.services.mozilla.com/D75377
In bug 1470348 we started to detach all SurfaceTextures from the
current GL context in CompositorOGL::Pause(). This was required for
VR, so that when the VR presentation was entered the SurfaceTextures
could be attached to the VR context instead.
When RenderCompositorEGL was implemented for webrender, we copied the
call to detach from CompositorOGL. However, due to extra complexity in
webrender's threading model, this is causing assertion failures.
VR no longer relies upon the SurfaceTextures being detached when the
compositor is paused, as it now uses its own SurfaceTexture
set. Therefore we can remove the detach call from both
CompositorOGL::Pause and RenderCompositorEGL::Pause.
Differential Revision: https://phabricator.services.mozilla.com/D74832
This was added to handle the case where a content process sent its display
list to the compositor before the parent knew which render root that content
belonged to (because the corresponding parent process display list hadn't
arrived yet). Now that we no longer have multiple render roots, all this
is unnecessary.
Differential Revision: https://phabricator.services.mozilla.com/D75123
In the past, there was a case that WebRenderTextureHost::mWrappedTextureHost was nullptr. But it does not happen with current gecko. WebRenderTextureHost is created only when wrapped TextureHost exist.
Differential Revision: https://phabricator.services.mozilla.com/D75237
Two VideoBridgeParents (one within the GPU process, one from RDD) are already supported. Then the comment is obsoleted.
Differential Revision: https://phabricator.services.mozilla.com/D74792