Gather stats for most calls to `profiler_add_marker()`, including the time to
allocate payloads if any.
Differential Revision: https://phabricator.services.mozilla.com/D43420
--HG--
extra : moz-landing-system : lando
All calls to `profiler_add_marker()` (outside of the profilers code) are
now replaced by either:
- `PROFILER_ADD_MARKER(name, categoryPair)`
- `PROFILER_ADD_MARKER_WITH_PAYLOAD(name, categoryPair, TypeOfMarkerPayload,
(payload, ..., arguments))`
This makes all calls consistent, and they won't need to prefix the category pair
with `JS::ProfilingCategoryPair::`.
Also it will make it easier to add (and later remove) internal-profiling
instrumentation (bug 1576550), and to replace heap-allocated payloads with
stack-allocated ones (bug 1576555).
Differential Revision: https://phabricator.services.mozilla.com/D43588
--HG--
extra : moz-landing-system : lando
Previously, clip nodes interned the local clip information, but
stored the spatial node and the local position as part of the
instance.
This was required since the local position of clips would change
when a new display was sent after scrolling. However, since we
now handle this via external scroll offsets, the local position
is stable, and we can intern both the position and spatial node.
This greatly simplifies some in-progress work for picture caching,
where we want to be able to quickly identify clip chain nodes that
are shared between elements of a display list. With this change,
comparing the item uid of the interned clip node is enough to
guarantee equality of the shared clips.
Differential Revision: https://phabricator.services.mozilla.com/D44436
--HG--
extra : moz-landing-system : lando
I had accidentally flipped things around so that the framebuffers were only
deleted when a registry was set.
Differential Revision: https://phabricator.services.mozilla.com/D44411
--HG--
extra : moz-landing-system : lando
This makes the fill rate numbers which are displayed in the FPS overlay a lot more reasonable.
It also requires the TransformAndClipBounds fix from bug 1578045 for correct numbers.
Depends on D44337
Differential Revision: https://phabricator.services.mozilla.com/D44338
--HG--
extra : moz-landing-system : lando
This creates and updates layers that draw the same things as RenderDebugOverlay().
The code is duplicated so that the overlay can be independent of the compositing
layer content drawing. All layers need to be drawn first, and the GPU stats from
that layer are shown in mGPUStatsLayer.
Depends on D44336
Differential Revision: https://phabricator.services.mozilla.com/D44337
--HG--
extra : moz-landing-system : lando
This essentially backs out the two patches from bug 1565668 that added this
functionality.
Differential Revision: https://phabricator.services.mozilla.com/D44330
--HG--
extra : moz-landing-system : lando
CompositingRenderTargetOGL objects are no longer reused between frames. They are
recreated each frame around a reused framebuffer. This lets us remove the
SetOrigin method again, because we specify the right render target origin on
creation.
Depends on D44328
Differential Revision: https://phabricator.services.mozilla.com/D44329
--HG--
extra : moz-landing-system : lando
This returns the raw framebuffer GLuint and lets the caller bind it.
Initially I wanted to return a RefPtr<MozFramebuffer>, but then I discovered
that MozFramebuffer is not a refcounted class and prefers UniquePtrs.
Depends on D44324
Differential Revision: https://phabricator.services.mozilla.com/D44325
--HG--
extra : moz-landing-system : lando
This uses MacIOSurface internally. NextSurfaceAsDrawTarget locks the MacIOSurface,
and NotifySurfaceReady unlocks it if necessary.
Depends on D44321
Differential Revision: https://phabricator.services.mozilla.com/D44322
--HG--
extra : moz-landing-system : lando
The comments above these methods refer to NextSurface* methods which will be
added in later patches.
Differential Revision: https://phabricator.services.mozilla.com/D44321
--HG--
extra : moz-landing-system : lando
The tile size is configurable with the prefs layers.compositing-tiles.width/height.
On macOS, whenever a CALayer is touched, the window server will recomposite the
entire layer to the screen. There is no API to mark parts of a layer as damaged.
So if we want the window server to only redraw a small part of the screen, we
need to only touch small layers. This patch achieves that using tiles; whenever
the compositor needs to redraw an area, all tiles that overlap this area will
be drawn to their layers and the window server will recomposite those layers.
On Intel GPUs, compositing in tiles should also help reduce GPU times if there
are multiple layers of overdraw: The overdraw will have better cache locality.
However, the magnitude of this effect is not known and requires further research.
Differential Revision: https://phabricator.services.mozilla.com/D43881
--HG--
extra : moz-landing-system : lando
This means that when something changes in an opaque layer, the window server
only needs to copy the opaque layer to the screen and can avoid recomputing any
window backgrounds for transparent parts of the window. This can save power,
especially when transparent parts of the window use the macOS vibrancy effect,
which requires the window server to compute a blur and to composite windows
behind our window.
Differential Revision: https://phabricator.services.mozilla.com/D43880
--HG--
extra : moz-landing-system : lando
This change breaks the draw-fps overlay when using native layers. I'll try to
fix that in a new bug soon.
The do { } while(0) loop looks a bit odd, but it'll get replaced with a proper
loop in bug 1574586.
Differential Revision: https://phabricator.services.mozilla.com/D43879
--HG--
extra : moz-landing-system : lando
This makes profiler screenshots and frame recording work again, when native
layers are used. The copying is a bit unfortunate. Maybe we can combine this
copy with the first downscaling step in the future. Or for frame recording,
which doesn't use downscaling, we could readback the layers individually and
reassemble them in CPU memory. But both of those solutions are more complex
than this.
Differential Revision: https://phabricator.services.mozilla.com/D43877
--HG--
extra : moz-landing-system : lando
This is so that we can invalidate all layers when screenshot profiling has
started, and not just the first layer.
Differential Revision: https://phabricator.services.mozilla.com/D43874
--HG--
extra : moz-landing-system : lando
This removes any *TargetContext methods from the Compositor interface and moves
mTarget tracking into the compositor implementations.
Differential Revision: https://phabricator.services.mozilla.com/D43872
--HG--
extra : moz-landing-system : lando
In the end we want to have BeginFrameForWindow, BeginFrameForTarget, and
BeginFrameForNativeLayers, the latter with multiple Begin/EndRenderingToNativeLayer
pairs nested inside.
This is the first step.
CompositorOGL and CompositorD3D11 keep their internal BeginFrame method but make
it private.
Differential Revision: https://phabricator.services.mozilla.com/D43871
--HG--
extra : moz-landing-system : lando
The call to TransformAndClipBounds already clips destRect to renderBounds.
However, if the resulting rect was empty, the Inflate call would make it
non-empty again. And now the decision whether we would cull would depend on the
rect's position: Sometimes TransformAndClipBounds would place the empty rect at
a position along an edge of renderBounds, and then the inflated-from-nothingness
2x2 rect would overlap renderBounds and we wouldn't cull.
Differential Revision: https://phabricator.services.mozilla.com/D43870
--HG--
extra : moz-landing-system : lando