[webkit-changes] [WebKit/WebKit] 2b8b70: [WPE][GTK][Skia] High memory usage repeatedly usin...
Adrian Perez
noreply at github.com
Mon Oct 14 05:06:28 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2b8b7072fa8ec617ef88bfb1d4d6b37924a3cca2
https://github.com/WebKit/WebKit/commit/2b8b7072fa8ec617ef88bfb1d4d6b37924a3cca2
Author: Adrian Perez de Castro <aperez at igalia.com>
Date: 2024-10-14 (Mon, 14 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:
-----------
[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
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list