These vectors are rebuilt once per frame. we can't recycle them because they are sent to the renderer. On a 4k screen for most sites the element counts are low enough that we can get away with preallocation from a pessimistic estimate, but high enough that reallocation happens a few times per frame and takes a small but visible portion of the profile.
Differential Revision: https://phabricator.services.mozilla.com/D79457
When Tab is moved to another window, all async ImageHosts need to update CompositorBridgeID. It is used for calling ScheduleComposition().
Differential Revision: https://phabricator.services.mozilla.com/D79068
This is an attempt to improve our relationship with the drivers.
Currently, we work with the instance buffer limit dictated by the macOS drivers.
We can consider lowering it, since it will only make the driver work eaiser.
Differential Revision: https://phabricator.services.mozilla.com/D78164
When a transform depends on the layout size of an element, one can see
visual distortions caused by the difference between the unsnapped size
used in the transform, and the snapped size calculated during scene
building. Ideally we could compute the transform after we snap, rather
than before. This patch adds support for a computed reference frame
which takes parameters to calculate the ideal transform dynamically.
In a future patch, we should make videos take advantage of this same
mechanism to avoid similar problems. This requires support for mirroring
and rotations.
Differential Revision: https://phabricator.services.mozilla.com/D77956
We can perform the same function as RecyclingSourceSurface by checking
the ref count of the underlying surface directly. We need to ensure
WebRender is explicitly aware that it is a recycled surface, but that is
easily achieved by changing the type of the surface. This avoids
unnecessary heap allocations, particularly in the case where many
elements on the same page refer to the same animation (and thus
duplicating RecyclingSourceSurface objects).
Differential Revision: https://phabricator.services.mozilla.com/D77513
The MVM is needed for both handling of meta-viewport tags and APZ zooming.
However, the set of functionality needed in the two modes are not the same.
This patch adds a mechanism to create an MVM with a flag that lets it know
which mode it is operating in. Eventually we may want to split this into two
or more classes but for now this seems like a reasonable way forward.
The flag is currently set on the MVM on creation based on whether or not the
meta-viewport support is needed. There's no code that meaningfully *uses* the
flag yet, so this patch should have no functional change. The bulk of the
patch is ensuring that we appropriately destroy and re-create the MVM if the
flag required changes.
Differential Revision: https://phabricator.services.mozilla.com/D79224
The main idea here is lifting the storages of batches, instances, and instance rects,higher up. Currently, to the level of the alpha/opaque batcher.
In the short term, this would result in less heap allocations on frame building.
For example, we no longer have a Vec<InstanceRect> per batch, stored in a separate Vec,
and we don't have a separate Vec<InstanceData> per batch.
There is also a matter of code refactor and cleanup that could make our life better.
In the longer term, once Angle is updated, we'll be able to lift the VBO updates up
accordingly, and use baseInstance drawing with them.
Sub-commits:
- Minor refactor of the batch intersection logic
- Instance stacks for transparent alpha batches
- Use instance stacks for opaque batches as well
- Implement and re-enable batch list merging
- Encapsulate instance stack LRU indexing into a class
- Internal BatchList type, bumped StackIndex size.
- Adjust the tests
- Test the stack count of 4
Differential Revision: https://phabricator.services.mozilla.com/D76715
In the first-paint case, we are accepting the incoming scroll metadata
wholesale, so most of the consequences of this code block will happen
anyways -- except for the extra repaint, which is not actually needed
and in fact undesirable in the first-paint case.
Differential Revision: https://phabricator.services.mozilla.com/D79195
Simple implementation of skipping SyncObjectD3D11Host::Synchronize(). More optimization could be done in Bug 1635629.
Differential Revision: https://phabricator.services.mozilla.com/D75781
> /builds/worker/checkouts/gecko/gfx/gl/SharedSurface.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]
Old compilers don't realize the switch being exhaustive means the
function always returns, which we workaround here.
Differential Revision: https://phabricator.services.mozilla.com/D78837
* 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
> /builds/worker/checkouts/gecko/gfx/gl/SharedSurface.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]
Old compilers don't realize the switch being exhaustive means the
function always returns, which we workaround here.
Differential Revision: https://phabricator.services.mozilla.com/D78837
* 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
The flag is not required for SharedSurface_SurfaceTexture, as
GeckoSurfaceTexture is reference counted. When the GeckoSurface is
disposed on the client side it simply decrements the refcount of the
GeckoSurfaceTexture on the host side, which will remain alive until
the TextureHost's reference is also dropped.
Differential Revision: https://phabricator.services.mozilla.com/D79073