[webkit-changes] [WebKit/WebKit] c392d3: [HDR] Scan the render layer tree for HDR content o...

Said Abou-Hallawa noreply at github.com
Wed Feb 26 17:10:27 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c392d3b6bf926955abc7b2037e6c3b1f379ff53f
      https://github.com/WebKit/WebKit/commit/c392d3b6bf926955abc7b2037e6c3b1f379ff53f
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2025-02-26 (Wed, 26 Feb 2025)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayerBacking.cpp

  Log Message:
  -----------
  [HDR] Scan the render layer tree for HDR content only if the document has at least one HDR image or canvas
https://bugs.webkit.org/show_bug.cgi?id=288419
rdar://145515241

Reviewed by Simon Fraser.

Scanning the renderer of a render layer and its descendants for HDR contents is
costly. To optimize the PLT, the traversal for HDR content can be disabled until
an HDR image is loaded or an HDR canvas context is created.

A flag can be kept on the Document to tell whether it hasPaintedHDRContent() or
not. This flag can be used by Document::canDrawHDRContent() which is consulted
for before starting the traversal for HDR content.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::canDrawHDRContent const):
Pass the view of the main frame as the widget to screenSupportsHighDynamicRange().
This way, the screen properties which was sent from the UIP to the WebP, can be
be used instead of recalculating them.

* Source/WebCore/dom/Document.h:
(WebCore::Document::setHasPaintedHDRContent):
(WebCore::Document::hasPaintedHDRContent const):
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::canDrawHDRContent const): Deleted.
* Source/WebCore/page/Page.h:
* Source/WebCore/rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::PaintedContentRequest::PaintedContentRequest):
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::PaintedContentsInfo::PaintedContentsInfo):

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