[webkit-changes] [WebKit/WebKit] 876cd0: Use the Copy CompositeOperator when copying canvas...

mattwoodrow noreply at github.com
Thu Mar 9 19:32:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 876cd0f5d2135fb3b17077390274658f1b586c1c
      https://github.com/WebKit/WebKit/commit/876cd0f5d2135fb3b17077390274658f1b586c1c
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-03-09 (Thu, 09 Mar 2023)

  Changed paths:
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLCanvasElement.h
    M Source/WebCore/platform/graphics/GraphicsLayer.cpp
    M Source/WebCore/platform/graphics/GraphicsLayer.h
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
    M Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
    M Source/WebCore/rendering/RenderHTMLCanvas.cpp
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm

  Log Message:
  -----------
  Use the Copy CompositeOperator when copying canvas into its layer.
https://bugs.webkit.org/show_bug.cgi?id=253614

Reviewed by Simon Fraser.

When the canvas buffer is the only draw into the layer, we should be able to just directly copy the pixels instead of blending.
This also means we can skip clearing the back buffer.

* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
* Source/WebCore/html/HTMLCanvasElement.h:
* Source/WebCore/platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::paintUsingCompositeCopy const):
(WebCore::GraphicsLayer::setPaintUsingCompositeCopy):
(WebCore::GraphicsLayer::canCopy const): Deleted.
(WebCore::GraphicsLayer::setCanCopy): Deleted.
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerPaintUsingCompositeCopy const):
(WebCore::PlatformCALayerClient::platformCALayerCanCopy const): Deleted.
* Source/WebCore/rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
* Source/WebCore/rendering/RenderLayer.h:
(WebCore::RenderLayer::paintUsingCompositeCopy const):
(WebCore::RenderLayer::setPaintUsingCompositeCopy):
(WebCore::RenderLayer::canCopy const): Deleted.
(WebCore::RenderLayer::setCanCopy): Deleted.
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):

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




More information about the webkit-changes mailing list