mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Allow construction of PaintingSurface directly from IOSurface
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.
This commit is contained in:
committed by
Alexander Kalenik
parent
bfdf52701f
commit
e683700fe6
@@ -1408,8 +1408,7 @@ void TraversableNavigable::paint(DevicePixelRect const& content_rect, Painting::
|
||||
#ifdef AK_OS_MACOS
|
||||
if (m_metal_context && m_skia_backend_context && is<Painting::IOSurfaceBackingStore>(target)) {
|
||||
auto& iosurface_backing_store = static_cast<Painting::IOSurfaceBackingStore&>(target);
|
||||
auto texture = m_metal_context->create_texture_from_iosurface(iosurface_backing_store.iosurface_handle());
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_metal_surface(*texture, m_skia_backend_context);
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_iosurface(iosurface_backing_store.iosurface_handle(), *m_skia_backend_context);
|
||||
Painting::DisplayListPlayerSkia player(*m_skia_backend_context, painting_surface);
|
||||
player.execute(*display_list);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user