[webkit-changes] [WebKit/WebKit] 0c6288: Remove BitmapImage::updateFromSettings()

Said Abou-Hallawa noreply at github.com
Thu Jan 25 12:16:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c6288be7ffe1f75fcd39a6bd2aa10ee6afa993f
      https://github.com/WebKit/WebKit/commit/0c6288be7ffe1f75fcd39a6bd2aa10ee6afa993f
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
    M Source/WebCore/platform/graphics/BitmapImage.cpp
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/graphics/ImagePaintingOptions.h
    M Source/WebCore/platform/graphics/ImageTypes.h
    M Source/WebCore/rendering/BackgroundPainter.cpp
    M Source/WebCore/rendering/RenderBoxModelObject.cpp
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/svg/RenderSVGImage.cpp
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  Remove BitmapImage::updateFromSettings()
https://bugs.webkit.org/show_bug.cgi?id=267607
rdar://121077174

Reviewed by Cameron McCormack.

Calculate all the image painting options before calling BitmapImage::draw().
Remove all the calls to BitmapImage::updateFromSettings() and pass the calculated
AllowImageSubsampling and ShowDebugBackground through ImagePaintingOptions.

The first frame of an animated image had to be decoded synchronously. In fact
this restriction is not needed. The rules to decode the static image and the
first frame of an animated image should be the same.

Late decoded frames of an animated images was showing a yellow rectangle if
showDebugBackground is enabled. This is not really needed since the animation
does not advance until the next frame is fully decoded.

* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* Source/WebCore/platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
(WebCore::BitmapImage::subsamplingLevelForScaleFactor):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::advanceAnimation):
(WebCore::BitmapImage::decode):
(WebCore::BitmapImage::updateFromSettings): Deleted.
* Source/WebCore/platform/graphics/BitmapImage.h:
* Source/WebCore/platform/graphics/ImagePaintingOptions.h:
(WebCore::ImagePaintingOptions::allowImageSubsampling const):
(WebCore::ImagePaintingOptions::showDebugBackground const):
(WebCore::ImagePaintingOptions::setOption):
* Source/WebCore/platform/graphics/ImageTypes.h:
* Source/WebCore/rendering/BackgroundPainter.cpp:
(WebCore::BackgroundPainter::paintFillLayer):
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
* Source/WebCore/rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* Source/WebCore/rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paintIntoRect):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::imageFrameIndex):

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




More information about the webkit-changes mailing list