Enable -Wexit-time-destructors for all in-tree library targets and
update process-lifetime library statics so they no longer register
exit-time destructors. Long-lived caches, lookup tables, singleton
registries, and generated constants now use NeverDestroyed or leaked
references where the data is intended to live until process exit.
Update LibWeb, LibLine, and the binding generators so regenerated
sources follow the same rule instead of reintroducing destructed
statics.
The compositor present path submitted Skia work with a synchronous GPU
wait, so each present_frame call stayed blocked until the backend
finished the submitted work. That serialized compositor processing
behind GPU completion even though the presented-bitmap acknowledgement
already controls backing-store reuse.
Add an async Skia flush-and-submit entrypoint and have the compositor
track pending presents until the Skia finished callback runs back on the
compositor event loop. did_present_frame now fires from that completion
path, while the existing presented_bitmap_ready_to_paint acknowledgement
remains the reuse gate for client-presented bitmaps.
Ganesh does not reliably run the finished proc without explicit async
work polling on this backend, so pending presents keep a completion
timer alive to call checkAsyncWorkCompletion().
The compositor thread had local Skia resource cache cleanup in its
surface flush helper, but the compositor process uses the same backend
through its own paint and present path. That left the new process path
without the deferred and high-watermark purging policy.
Move the cleanup into SkiaBackendContext::flush_and_submit(), keeping
the public flush API shared while letting the Vulkan and Metal backends
provide only the backend-specific submit implementation. This keeps the
existing compositor thread behavior and applies the same cache pressure
handling to compositor process flushes.
Set an explicit resource cache limit on Skia GPU contexts and ask
Skia to perform deferred cleanup from the compositor at a throttled
cadence. When resource usage crosses high watermarks, request more
aggressive cleanup and purge scratch resources only as a last step.
Also cap the decoded frame Skia image cache by approximate bitmap
bytes and entry count so route changes and pointer-driven repaint
churn cannot keep an unbounded number of uploaded image textures
alive.
Until now we only have a single process-wide SkiaBackendContext exposed
through SkiaBackendContext::the(). To let other threads own their own
context, expose the underlying factory as
create_independent_gpu_backend() so callers can build additional
contexts that are not the singleton.
While here, give SkiaVulkanBackendContext and SkiaMetalBackendContext
destructors so each context releases its Vulkan/Metal handles when it is
torn down, instead of leaking them.
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.
SkFontMgr_New_FontConfig now requires a font scanner to be passed in.
There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.
The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.
The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.
SkFontMgr_New_FontConfig now requires a font scanner to be passed in.
There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.
The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.
The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
Previously, constructing a PaintingSurface from an IOSurface required
wrapping IOSurface into a Metal texture before passing it to the
PaintingSurface constructor. This process was cumbersome, as the caller
needed access to a MetalContext to perform the wrapping.
With this change SkiaBackendContext maintains a reference to the
MetalContext which makes it possible to do:
IOSurface -> MetalTexture -> SkSurface within a PaintingSurface
constructor.