Allow composited clip-path to be updated without a layer repaint
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 18:14:10 +0000 (18:14 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 18:14:10 +0000 (18:14 +0000)
commit559895073d99fdbc859538d66ce7c0653ce45359
treecaaa5cb486757f92efffa2e54933f30dfa084ac7
parent11bff476ebefd079870157ad9b0523200f2b1ec8
Allow composited clip-path to be updated without a layer repaint
https://bugs.webkit.org/show_bug.cgi?id=142384

Reviewed by Zalan Bujtas.

Source/WebCore:

When clip-path is mapped to a compositing shape layer mask, we can just
push a new shape to the GraphicsLayer to update the clip path, without
needing to repaint.

Achieve this by adding ContextSensitivePropertyClipPath. When set, and the
stars are aligned, issue a StyleDifferenceRecompositeLayer rather than
a StyleDifferenceRepaint.

We ask RenderLayerCompositor whether the clip path can be composited
to hide platform differences related to whether GraphicsLayer supports
shape masks.

Test: compositing/masks/compositing-clip-path-change-no-repaint.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference): Remove obvious comment
about opacity. Handle ContextSensitivePropertyClipPath.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::canCompositeClipPath): If we have a mask
we have to paint the mask + clip path into the mask layer (mirrors code in
RenderLayerBacking::updateMaskingLayer but isn't quite similar enough to share).
* rendering/RenderLayerCompositor.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint): Set ContextSensitivePropertyClipPath
and don't return, as is normal for context-sensitive property handling.
* rendering/style/RenderStyleConstants.h: Line things up to avoid future bit
fumbles, and remove unnecessary braces.

LayoutTests:

Test repaint with a clip-path change.

* compositing/masks/compositing-clip-path-change-no-repaint-expected.txt: Added.
* compositing/masks/compositing-clip-path-change-no-repaint.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/masks/compositing-clip-path-change-no-repaint-expected.txt [new file with mode: 0644]
LayoutTests/compositing/masks/compositing-clip-path-change-no-repaint.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h