Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: afbdfa6e4029e7ff7d76e8b04d049915f4528dad
      
https://github.com/WebKit/WebKit/commit/afbdfa6e4029e7ff7d76e8b04d049915f4528dad
  Author: Said Abou-Hallawa <s...@apple.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/compositing/hdr/hdr-basic-image.html
    M LayoutTests/compositing/hdr/hdr-css-image.html
    A LayoutTests/compositing/hdr/hdr-svg-inline-image.html
    M LayoutTests/fast/images/hdr-basic-image.html
    M LayoutTests/fast/images/hdr-css-image.html
    A LayoutTests/fast/images/hdr-svg-inline-image-expected.html
    A LayoutTests/fast/images/hdr-svg-inline-image.html
    M LayoutTests/platform/ios/TestExpectations
    A LayoutTests/platform/ios/compositing/hdr/hdr-svg-inline-image-expected.txt
    M LayoutTests/platform/mac-wk2/TestExpectations
    A 
LayoutTests/platform/mac-wk2/compositing/hdr/hdr-svg-inline-image-expected.txt
    M Source/WebCore/html/ImageBitmap.cpp
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/loader/cache/CachedImage.h
    M Source/WebCore/loader/cache/CachedImageClient.h
    M Source/WebCore/page/ChromeClient.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/platform/graphics/BitmapImage.cpp
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/graphics/BitmapImageSource.h
    M Source/WebCore/platform/graphics/Image.h
    M Source/WebCore/platform/graphics/ImageObserver.h
    M Source/WebCore/platform/graphics/ImageSource.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderLayerBacking.h
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.h
    M Source/WebCore/svg/SVGImageElement.h
    M Source/WebCore/svg/graphics/SVGImage.cpp
    M Source/WebCore/svg/graphics/SVGImage.h
    M Source/WebCore/svg/graphics/SVGImageClients.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Tools/TestWebKitAPI/Tests/WebCore/SVGImageCasts.cpp

  Log Message:
  -----------
  [HDR] Enable HDR display for SVG <image> elements
https://bugs.webkit.org/show_bug.cgi?id=289419#
rdar://146582114

Reviewed by Cameron McCormack.

BitmapImage and SVGImage will implement the virtual method 
hasPaintedHDRContent().
This will enable HDR display support for these images. This method will replace
the existing method headroom() since it does not make sense to have SVGImage
implement it. Similarly setHasPaintedHDRContentForTesting() will replace
setHeadroomForTesting().

LegacyRenderSVGImage needs to implement notifyFinished() which will be used to
mark the document to have setHasPaintedHDRContent(). It will be used also to 
call
RenderLayer::contentChanged(ContentChangeType::Image) for the SVGImage case.

To go from LegacyRenderSVGImage inside an SVGImage to the parent layer which 
owns
the SVGImage, the SVGImageChromeClient will be used. A new virtual method called
didFinishLoadingImageForSVGImage() will be added to ChromeClient. This method 
will
be called form LegacyRenderSVGImage::notifyFinished() through Page. This method
will use the ImageObserver to call the method 
RenderElement::imageContentChanged()
which will mark the layer for image content change.

* LayoutTests/TestExpectations:
* LayoutTests/compositing/hdr/hdr-basic-image.html:
* LayoutTests/compositing/hdr/hdr-css-image.html:
* LayoutTests/compositing/hdr/hdr-svg-inline-image.html: Copied from 
LayoutTests/compositing/hdr/hdr-basic-image.html.
* LayoutTests/fast/images/hdr-basic-image.html:
* LayoutTests/fast/images/hdr-css-image.html:
* LayoutTests/fast/images/hdr-svg-inline-image-expected.html: Added.
* LayoutTests/fast/images/hdr-svg-inline-image.html: Copied from 
LayoutTests/fast/images/hdr-basic-image.html.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/ios/compositing/hdr/hdr-svg-inline-image-expected.txt: 
Added.
* LayoutTests/platform/mac-wk2/TestExpectations:
* 
LayoutTests/platform/mac-wk2/compositing/hdr/hdr-svg-inline-image-expected.txt: 
Added.
* Source/WebCore/html/ImageBitmap.cpp:
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::hasPaintedHDRContent const):
(WebCore::CachedImage::CachedImageObserver::imageContentChanged):
(WebCore::CachedImage::imageContentChanged):
(WebCore::CachedImage::headroom const): Deleted.
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::imageContentChanged):
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::didFinishLoadingImageForSVGImage):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::didFinishLoadingImageForSVGImage):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* Source/WebCore/platform/graphics/BitmapImage.h:
* Source/WebCore/platform/graphics/BitmapImageSource.h:
* Source/WebCore/platform/graphics/Image.h:
(WebCore::Image::hasPaintedHDRContent const):
(WebCore::Image::headroom const): Deleted.
* Source/WebCore/platform/graphics/ImageObserver.h:
* Source/WebCore/platform/graphics/ImageSource.h:
(WebCore::ImageSource::setHasPaintedHDRContentForTesting):
(WebCore::ImageSource::hasPaintedHDRContentForTesting const):
(WebCore::ImageSource::setHeadroomForTesting): Deleted.
(WebCore::ImageSource::headroomForTesting const): Deleted.
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::imageContentChanged):
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::PaintedContentsInfo::PaintedContentsInfo):
(WebCore::PaintedContentsInfo::isContentsTypeSatisfied const):
(WebCore::PaintedContentsInfo::isRenderElementWithHDR):
(WebCore::PaintedContentsInfo::determineContentsType):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::isRenderElementWithHDR const):
(WebCore::PaintedContentsInfo::isReplacedElementWithHDR): Deleted.
(WebCore::RenderLayerBacking::isReplacedElementWithHDR const): Deleted.
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.cpp:
(WebCore::LegacyRenderSVGImage::notifyFinished):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.h:
* Source/WebCore/svg/SVGImageElement.h:
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::hasPaintedHDRContent const):
* Source/WebCore/svg/graphics/SVGImage.h:
* Source/WebCore/svg/graphics/SVGImageClients.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setHasPaintedHDRContentForTesting):
(WebCore::Internals::setHeadroomForTesting): Deleted.
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Tools/TestWebKitAPI/Tests/WebCore/SVGImageCasts.cpp:

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