Branch: refs/heads/webkitglib/2.46
Home: https://github.com/WebKit/WebKit
Commit: 1fc252fdd5fe146607f483640caec11eaa2bf222
https://github.com/WebKit/WebKit/commit/1fc252fdd5fe146607f483640caec11eaa2bf222
Author: Adrian Perez de Castro <[email protected]>
Date: 2024-10-15 (Tue, 15 Oct 2024)
Changed paths:
M Source/WebCore/platform/SourcesSkia.txt
M Source/WebCore/platform/graphics/IntRect.h
M
Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp
A Source/WebCore/platform/graphics/skia/IntRectSkia.cpp
Log Message:
-----------
Cherry-pick 285116@main (2b8b7072fa8e).
https://bugs.webkit.org/show_bug.cgi?id=281042
[WPE][GTK][Skia] High memory usage repeatedly using putImageData on
accelerated canvas
https://bugs.webkit.org/show_bug.cgi?id=281042
Reviewed by Carlos Garcia Campos.
Change ImageBufferSkiaAcceleratedBackend::putPixelBuffer() to avoid
making a temporary scratch buffer with the same size as the canvas
backing SkSurface on each canvas.putImageData() invocation, which may
happen many times in between each composition.
Instead of using the ImageBufferBackend::putPixelBuffer() helper on
a temporary buffer with the same size as the canvas backing surface,
bring inline part of the source/destination rectangle calculations to
operate strictly on the part of the source PixelBuffer that will be
applied onto the backing surface. The source pixel data gets passed
directly to Skia in the rather common case where the destination
alpha mode matches that of the canvas backing surface (and Skia will
handle any other conversions, if needed); otherwise going through
a scratch buffer is still done, but its size is limited to that of
the clipped source rectangle to convert only the pixel area that
gets applied onto the canvas backing surface.
On top of reducing memory usage, this makes the MotionMark Images
test ~2.5x faster, and its Canvas putPixel/getPixel test ~1.2x faster.
* Source/WebCore/platform/SourcesSkia.txt: List IntRectSkia.cpp file.
* Source/WebCore/platform/graphics/IntRect.h: Add SkIRect forward
declaration and operator methods to convert instances to/from
WebCore::IntRect.
*
Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::putPixelBuffer):
* Source/WebCore/platform/graphics/skia/IntRectSkia.cpp: Added.
(WebCore::IntRect::IntRect):
(WebCore::IntRect::operator SkIRect const):
Canonical link: https://commits.webkit.org/285116@main
Canonical link: https://commits.webkit.org/282416.210@webkitglib/2.46
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes