[CSS Element Blending] Implement the software path of -webkit-blend-mode with Core...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 12:40:08 +0000 (12:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 12:40:08 +0000 (12:40 +0000)
commit9af1ac841405c7beeab774f788f41a2b38406641
tree9fbc86d1d4488ae273aca676768f71a98053205c
parent866b9cdf95e69f7a137728610cad484647a0469f
[CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics.
https://bugs.webkit.org/show_bug.cgi?id=99119

Patch by Mihai Tica <mitica@adobe.com> on 2014-02-12
Reviewed by Simon Fraser.

Source/WebCore:

This patch adds support for -webkit-blend-mode with Core Graphics.
The layer promotion code that forced compositing when blending was detected has been removed.
Remaining work for the software path is to detect and implement isolation of the blending operation:
as stated in the spec, blending should be limited to the parent stacking context.

Tests: css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html
       css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html
       css3/compositing/blend-mode-simple-composited.html
       css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html

* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Remove CompositingReasonBlending.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers): Set the blendMode on the GraphicsContext.
* rendering/RenderLayer.h: paintsWithTransparency should return true when a blendMode is set.
* rendering/RenderLayerCompositor.cpp: Remove promotion code when a blendMode is detected.
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::requiresOwnBackingStore): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::reasonsForCompositing): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::logReasonsForCompositing): Remove CompositingReasonBlending reason.
* rendering/RenderLayerCompositor.h:
- Remove the requiresCompositingForBlending method
- Remove the CompositingReasonBlending from the CompositingReasons enum.

LayoutTests:

* css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt: Copied from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html: Test if having an overlapping composited sibling forces compositing of a blended element.
* css3/compositing/blend-mode-layers.html: Update to test both the software and the hardware path.
* css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt: Renamed from LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html: Test if the parent of an accelerated element with -webkit-blend-mode is promoted.
* css3/compositing/blend-mode-reflection.html: Update to test both the software and the hardware path.
* css3/compositing/blend-mode-should-not-have-compositing-layer.html: Removed.
* css3/compositing/blend-mode-simple-composited.html: Test all the blend modes for the hardware path.
* css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt: Renamed from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html: Test to ensure that an element with -webkit-blend-mode and a composited descendant is also accelerated.
* css3/compositing/should-have-compositing-layer.html: Removed.
* platform/mac/css3/compositing/blend-mode-layers-expected.png:
* platform/mac/css3/compositing/blend-mode-layers-expected.txt:
* platform/mac/css3/compositing/blend-mode-overflow-expected.png:
* platform/mac/css3/compositing/blend-mode-overflow-expected.txt: Added.
* platform/mac/css3/compositing/blend-mode-reflection-expected.png:
* platform/mac/css3/compositing/blend-mode-reflection-expected.txt:
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.png: Added.
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt: Added.
* platform/mac/css3/compositing/blend-mode-simple-expected.png:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt [new file with mode: 0644]
LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html [new file with mode: 0644]
LayoutTests/css3/compositing/blend-mode-layers.html
LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt [moved from LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt with 52% similarity]
LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html [new file with mode: 0644]
LayoutTests/css3/compositing/blend-mode-reflection.html
LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer.html [deleted file]
LayoutTests/css3/compositing/blend-mode-simple-composited.html [new file with mode: 0644]
LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt [moved from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt with 71% similarity]
LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html [new file with mode: 0644]
LayoutTests/css3/compositing/should-have-compositing-layer.html [deleted file]
LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.png
LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt
LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.png
LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.png
LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt
LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/compositing/blend-mode-simple-expected.png
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h