[webkit-changes] [WebKit/WebKit] 0c562a: GradientImage::drawPattern() can trigger read back...

Simon Fraser noreply at github.com
Sat Sep 21 20:15:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c562a47ae674a636e4a682a61f976305c5b292f
      https://github.com/WebKit/WebKit/commit/0c562a47ae674a636e4a682a61f976305c5b292f
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-09-21 (Sat, 21 Sep 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/BitmapImage.cpp
    M Source/WebCore/platform/graphics/GradientImage.cpp
    M Source/WebCore/platform/graphics/GradientImage.h
    M Source/WebCore/svg/graphics/SVGImage.cpp

  Log Message:
  -----------
  GradientImage::drawPattern() can trigger read back from the GPU process
https://bugs.webkit.org/show_bug.cgi?id=280083
rdar://111943095

Reviewed by Said Abou-Hallawa.

Creating a NativeImage from an ImageBuffer in the WebContent process, with GPU rendering enabled,
requires readback from the GPU process, which is blocking.

We can fix this easily in `GradientImage::drawPattern()` by simply caching the ImageBuffer we've
already created. We make the same change in `SVGImage::drawPatternForContainer()` and
`BitmapImage::drawLuminanceMaskPattern()`

* Source/WebCore/platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawLuminanceMaskPattern):
* Source/WebCore/platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* Source/WebCore/platform/graphics/GradientImage.h:
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):

Canonical link: https://commits.webkit.org/284047@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