Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ca14e7517d743ab5bca0ed6fd7579799aa85aec
      
https://github.com/WebKit/WebKit/commit/3ca14e7517d743ab5bca0ed6fd7579799aa85aec
  Author: Adrian Perez de Castro <ape...@igalia.com>
  Date:   2024-11-19 (Tue, 19 Nov 2024)

  Changed paths:
    M 
Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp

  Log Message:
  -----------
  [GTK][WPE][Skia] Avoid temporary copies in getImageData()
https://bugs.webkit.org/show_bug.cgi?id=282915

Reviewed by Carlos Garcia Campos.

Change ImageBufferSkiaAcceleratedBackend::getPixelBuffer() to avoid
making a temporary scratch buffer with the same size as the canvas
backing SkSurface on each canvas.getImageData() invocation.

As in 285116@main, avoid using the ImageBufferBackend::getPixelBuffer()
helper on a temporary buffer, bring inline the needed calculations for
the source/destination areas, and wrap the PixelBuffer with a SkPixmap
that then gets passed directly to Skia. This way we can always let Skia
do the needed pixel format and alpha component type conversions.

On top of reducing memory usage, this makes the MotionMark Canvas
put/get Image Data test ~10x faster.

Covered by existing layout tests.

* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::getPixelBuffer):

Canonical link: https://commits.webkit.org/286795@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to