Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e133eeebaa2f248cca87f53cafee6841b8ed5b6
      
https://github.com/WebKit/WebKit/commit/8e133eeebaa2f248cca87f53cafee6841b8ed5b6
  Author: Matt Woodrow <[email protected]>
  Date:   2026-03-19 (Thu, 19 Mar 2026)

  Changed paths:
    M 
LayoutTests/compositing/canvas/hidpi-canvas-backing-store-invalidation-2.html
    M 
LayoutTests/compositing/canvas/hidpi-canvas-backing-store-invalidation.html
    M LayoutTests/compositing/canvas/hidpi-canvas-backing-store.html
    M LayoutTests/compositing/layer-creation/spanOverlapsCanvas-expected.txt
    M LayoutTests/compositing/tiling/huge-layer-canvas-resize.html
    M LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas.html
    M LayoutTests/fast/canvas/canvas-conic-gradient-angle.html
    M LayoutTests/fast/canvas/canvas-layer-alpha-drawing.html
    M LayoutTests/fast/canvas/canvas-render-layer.html
    M LayoutTests/fast/canvas/offscreen-clipped-expected.html
    M LayoutTests/fast/images/animated-gif-loop-count.html
    M LayoutTests/fast/images/animated-image-different-dest-size.html
    M LayoutTests/fast/images/animated-png-loop-count.html
    M LayoutTests/fast/repaint/canvas-object-fit-expected.txt
    M LayoutTests/platform/ios-18/compositing/hdr/hdr-basic-canvas-expected.txt
    R 
LayoutTests/platform/ios/compositing/canvas/accelerated-canvas-compositing-expected.txt
    M LayoutTests/platform/ios/compositing/hdr/hdr-basic-canvas-expected.txt
    M LayoutTests/platform/ios/fast/canvas/canvas-render-layer-expected.txt
    M 
LayoutTests/platform/mac-sequoia-wk2/compositing/hdr/hdr-basic-canvas-expected.txt
    M LayoutTests/platform/mac-wk2/compositing/hdr/hdr-basic-canvas-expected.txt
    R 
LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt
    R LayoutTests/platform/mac/fast/canvas/canvas-render-layer-expected.txt
    R LayoutTests/platform/mac/fast/repaint/canvas-putImageData-expected.txt
    M LayoutTests/svg/as-image/svg-cached-draw-canvas.html
    M Source/WebCore/rendering/RenderLayerBacking.cpp

  Log Message:
  -----------
  2D canvas unnecessarily forces a compositing layer
https://bugs.webkit.org/show_bug.cgi?id=310221
<rdar://172864747>

Reviewed by Said Abou-Hallawa.

Compositing for 2D canvas was added in 64284@main, which enabled 
IOSurface-backed canvas rendering.
This created a dedicated layer for the canvas, and forced IOSurface backing for 
the layer too (which
wasn't the default), so that drawing the canvas into the layer didn't incur 
readback.

Since then, IOSurface backing is the default for layers, so having a separate 
layer for the canvas
is just extra memory and compositing overhead.

This makes canvasCompositingStrategy check if the default backing store is 
accelerated, and only
creates a dedicated layer if needed.

* LayoutTests/compositing/canvas/hidpi-canvas-backing-store-invalidation-2.html:
* LayoutTests/compositing/canvas/hidpi-canvas-backing-store-invalidation.html:
* LayoutTests/compositing/canvas/hidpi-canvas-backing-store.html:
* LayoutTests/compositing/layer-creation/spanOverlapsCanvas-expected.txt:
* LayoutTests/compositing/tiling/huge-layer-canvas-resize.html:
* LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas.html:
* LayoutTests/fast/canvas/canvas-conic-gradient-angle.html:
* LayoutTests/fast/canvas/canvas-layer-alpha-drawing.html:
* LayoutTests/fast/canvas/canvas-render-layer.html:
* LayoutTests/fast/canvas/offscreen-clipped-expected.html:
* LayoutTests/fast/images/animated-gif-loop-count.html:
* LayoutTests/fast/images/animated-image-different-dest-size.html:
* LayoutTests/fast/images/animated-png-loop-count.html:
* LayoutTests/fast/repaint/canvas-object-fit-expected.txt:
* LayoutTests/platform/ios-18/compositing/hdr/hdr-basic-canvas-expected.txt:
* 
LayoutTests/platform/ios/compositing/canvas/accelerated-canvas-compositing-expected.txt:
 Removed.
* LayoutTests/platform/ios/compositing/hdr/hdr-basic-canvas-expected.txt:
* LayoutTests/platform/ios/fast/canvas/canvas-render-layer-expected.txt:
* 
LayoutTests/platform/mac-sequoia-wk2/compositing/hdr/hdr-basic-canvas-expected.txt:
* LayoutTests/platform/mac-wk2/compositing/hdr/hdr-basic-canvas-expected.txt:
* 
LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt:
 Removed.
* LayoutTests/platform/mac/fast/canvas/canvas-render-layer-expected.txt: 
Removed.
* LayoutTests/platform/mac/fast/repaint/canvas-putImageData-expected.txt: 
Removed.
* LayoutTests/svg/as-image/svg-cached-draw-canvas.html:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to