Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e099d2f02f229e22fb37df9240f2ca00e2209f0a
https://github.com/WebKit/WebKit/commit/e099d2f02f229e22fb37df9240f2ca00e2209f0a
Author: Carlos Garcia Campos <[email protected]>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h
M
Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp
M Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.h
M Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp
M Source/WebCore/platform/graphics/skia/SkiaSerializedImageBuffer.cpp
M Source/WebCore/platform/graphics/skia/SkiaSerializedImageBuffer.h
Log Message:
-----------
[Skia] Simplify canvas recording in ImageBufferSkiaAcceleratedBackend
https://bugs.webkit.org/show_bug.cgi?id=315552
Reviewed by Nikolas Zimmermann.
When we record the canvas in ImageBufferSkiaAcceleratedBackend, the
replay is always expected to happen in the same thread where the record
was done. That means we don't need fences for the accelerated images
recorded. We don't need to create a fence and wait for it before
reading/writing pixels either, in those cases we don't even need to
flush the context since read/write operations are done by skia API that
already flushed the context if needed internally. We only need to create
a fence when the surface snapshot is going to be rewrapped in a
different thread. We don't need to create the atlas layout builder
either, so this patch adds a new ContextMode to indicate we are
recording for the canvas and not for the tiles.
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::makeGLContextCurrentIfNeeded const):
(WebCore::GraphicsContextSkia::drawNativeImage):
(WebCore::GraphicsContextSkia::beginRecording):
(WebCore::GraphicsContextSkia::endRecording):
(WebCore::GraphicsContextSkia::trackAcceleratedRenderingFenceIfNeeded):
(WebCore::GraphicsContextSkia::enableStateReplayTracking): Deleted.
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h:
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::grContext const):
(WebCore::ImageBufferSkiaAcceleratedBackend::ensureCanvasRecordingContext):
(WebCore::ImageBufferSkiaAcceleratedBackend::replayCanvasRecordingContextIfNeeded):
(WebCore::ImageBufferSkiaAcceleratedBackend::flushContext):
(WebCore::ImageBufferSkiaAcceleratedBackend::prepareForDisplay):
(WebCore::ImageBufferSkiaAcceleratedBackend::createNativeImageReference):
(WebCore::ImageBufferSkiaAcceleratedBackend::getPixelBuffer):
(WebCore::ImageBufferSkiaAcceleratedBackend::putPixelBuffer):
(WebCore::ImageBufferSkiaAcceleratedBackend::flushCanvasRecordingContextIfNeeded):
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.h:
* Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp:
(WebCore::SkiaPaintingEngine::record):
* Source/WebCore/platform/graphics/skia/SkiaSerializedImageBuffer.cpp:
(WebCore::SkiaSerializedImageBuffer::SkiaSerializedImageBuffer):
(WebCore::SkiaSerializedImageBuffer::sinkIntoImageBuffer):
* Source/WebCore/platform/graphics/skia/SkiaSerializedImageBuffer.h:
Canonical link: https://commits.webkit.org/313877@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications