Changeset 163955 in webkit
- Timestamp:
- Feb 12, 2014 4:40:08 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 2 deleted
- 15 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r163953 r163955 1 2014-02-12 Mihai Tica <mitica@adobe.com> 2 3 [CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics. 4 https://bugs.webkit.org/show_bug.cgi?id=99119 5 6 Reviewed by Simon Fraser. 7 8 * 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. 9 * 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. 10 * css3/compositing/blend-mode-layers.html: Update to test both the software and the hardware path. 11 * css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt: Renamed from LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt. 12 * 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. 13 * css3/compositing/blend-mode-reflection.html: Update to test both the software and the hardware path. 14 * css3/compositing/blend-mode-should-not-have-compositing-layer.html: Removed. 15 * css3/compositing/blend-mode-simple-composited.html: Test all the blend modes for the hardware path. 16 * 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. 17 * 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. 18 * css3/compositing/should-have-compositing-layer.html: Removed. 19 * platform/mac/css3/compositing/blend-mode-layers-expected.png: 20 * platform/mac/css3/compositing/blend-mode-layers-expected.txt: 21 * platform/mac/css3/compositing/blend-mode-overflow-expected.png: 22 * platform/mac/css3/compositing/blend-mode-overflow-expected.txt: Added. 23 * platform/mac/css3/compositing/blend-mode-reflection-expected.png: 24 * platform/mac/css3/compositing/blend-mode-reflection-expected.txt: 25 * platform/mac/css3/compositing/blend-mode-simple-composited-expected.png: Added. 26 * platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt: Added. 27 * platform/mac/css3/compositing/blend-mode-simple-expected.png: 28 1 29 2014-02-12 Michał Pakuła vel Rutka <m.pakula@samsung.com> 2 30 -
trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt
r163954 r163955 1 2 1 (GraphicsLayer 3 2 (bounds 800.00 600.00) … … 10 9 (bounds 800.00 600.00) 11 10 (drawsContent 1) 12 (children 111 (children 2 13 12 (GraphicsLayer 14 13 (position 8.00 8.00) 15 (bounds 784.00 90.00) 16 (opacity 0.50) 17 (drawsContent 1) 18 (children 1 19 (GraphicsLayer 20 (bounds 160.00 90.00) 21 ) 22 ) 14 (bounds 100.00 100.00) 15 ) 16 (GraphicsLayer 17 (position 8.00 78.00) 18 (bounds 100.00 100.00) 23 19 ) 24 20 ) -
trunk/LayoutTests/css3/compositing/blend-mode-layers.html
r163633 r163955 47 47 float: left; 48 48 } 49 50 .composited { 51 -webkit-transform: translateZ(0); 52 } 49 53 </style> 50 54 </head> … … 58 62 <!-- setting the blendmode will create a new stacking context which causes z-index to change --> 59 63 <li><div class="div1"><div class="div2" style="-webkit-blend-mode: multiply"><div class="div3"></div></div></div></li> 64 <li><div class="div1"><div class="div2 composited" style="-webkit-blend-mode: multiply"><div class="div3"></div></div></div></li> 60 65 61 66 <!-- just setting slight opacity which causes a stacking context. This also causes z-index to be resolved to the stacking context --> … … 64 69 <!-- blending will now only happen upto the stacking context generated by opacity. Z-index is resolved against the stacking context of the div with the blendmode --> 65 70 <li><div class="div1" style="opacity:.99"><div class="div2" style="-webkit-blend-mode: multiply"><div class="div3"></div></div></div></li> 71 <li><div class="div1" style="opacity:.99"><div class="div2 composited" style="-webkit-blend-mode: multiply"><div class="div3"></div></div></div></li> 66 72 </ul> 67 73 </body> -
trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt
r163954 r163955 1 Test to make sure a blend mode creates a compositing layer. Test is successful of render tree shows compositing2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".4 5 6 PASS content has compositing layers7 8 1 (GraphicsLayer 9 2 (bounds 800.00 600.00) … … 18 11 (children 1 19 12 (GraphicsLayer 20 (position 8.00 76.00)21 (bounds 1 60.00 90.00)13 (position 18.00 10.00) 14 (bounds 100.00 100.00) 22 15 ) 23 16 ) -
trunk/LayoutTests/css3/compositing/blend-mode-reflection.html
r161628 r163955 21 21 float: left; 22 22 } 23 24 .composited { 25 -webkit-transform: translateZ(0); 26 } 23 27 </style> 24 28 </head> 25 29 26 <!-- This file should contain a duck on top of a gradient that has areflection.30 <!-- This file should contain two images of a duck on top of a gradient with reflection. 27 31 Both the duck and the reflection should blend. --> 28 32 <body> 29 33 <ul><li><img style="-webkit-blend-mode: multiply" src="resources/ducky.png"></li></ul> 34 <ul><li><img class="composited" style="-webkit-blend-mode: multiply" src="resources/ducky.png"></li></ul> 30 35 </body> -
trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt
r163954 r163955 1 2 1 (GraphicsLayer 3 2 (bounds 800.00 600.00) … … 12 11 (children 1 13 12 (GraphicsLayer 14 (position 8.00 8.00) 15 (bounds 784.00 90.00) 16 (opacity 0.50) 17 (drawsContent 1) 13 (position 8.00 10.00) 14 (bounds 100.00 100.00) 18 15 (children 1 19 16 (GraphicsLayer 20 (bounds 160.00 90.00) 17 (position 10.00 0.00) 18 (bounds 100.00 100.00) 21 19 ) 22 20 ) -
trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt
r161628 r163955 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 1914 RenderBlock {HTML} at (0,0) size 800x 1913 layer at (0,0) size 800x366 4 RenderBlock {HTML} at (0,0) size 800x366 5 5 RenderBody {BODY} at (8,16) size 784x0 6 6 RenderBlock {UL} at (0,0) size 784x0 … … 10 10 RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF] 11 11 RenderBlock (floating) {LI} at (385,5) size 160x50 [bgcolor=#FF00FF] 12 RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF] 12 13 RenderBlock (floating) {LI} at (555,5) size 160x50 [bgcolor=#FF00FF] 14 RenderBlock (floating) {LI} at (45,180) size 160x50 [bgcolor=#FF00FF] 15 RenderBlock (floating) {LI} at (215,180) size 160x50 [bgcolor=#FF00FF] 13 16 layer at (73,31) size 160x160 14 17 RenderBlock (relative positioned) {DIV} at (0,0) size 160x160 … … 19 22 layer at (223,41) size 80x150 20 23 RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00] 21 layer at (393,71) size 160x7522 RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]23 24 layer at (413,31) size 160x160 24 25 RenderBlock (relative positioned) {DIV} at (0,0) size 160x160 … … 31 32 layer at (563,41) size 80x150 32 33 RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00] 34 layer at (53,246) size 160x75 35 RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF] 36 layer at (73,206) size 160x160 37 RenderBlock (relative positioned) {DIV} at (0,0) size 160x160 38 layer at (53,216) size 80x150 39 RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00] 40 layer at (223,246) size 160x75 41 RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF] 42 layer at (243,206) size 160x160 43 RenderBlock (relative positioned) {DIV} at (0,0) size 160x160 44 layer at (223,216) size 80x150 45 RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00] -
trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt
r161628 r163955 6 6 RenderBlock {UL} at (0,0) size 784x0 7 7 RenderBlock (floating) {LI} at (45,5) size 130x260 8 RenderBlock {UL} at (0,0) size 784x0 9 RenderBlock (floating) {LI} at (185,5) size 130x260 8 10 layer at (53,21) size 130x130 9 11 RenderImage {IMG} at (0,0) size 130x130 12 layer at (193,21) size 130x130 13 RenderImage {IMG} at (0,0) size 130x130 -
trunk/Source/WebCore/ChangeLog
r163944 r163955 1 2014-02-12 Mihai Tica <mitica@adobe.com> 2 3 [CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics. 4 https://bugs.webkit.org/show_bug.cgi?id=99119 5 6 Reviewed by Simon Fraser. 7 8 This patch adds support for -webkit-blend-mode with Core Graphics. 9 The layer promotion code that forced compositing when blending was detected has been removed. 10 Remaining work for the software path is to detect and implement isolation of the blending operation: 11 as stated in the spec, blending should be limited to the parent stacking context. 12 13 Tests: css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html 14 css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html 15 css3/compositing/blend-mode-simple-composited.html 16 css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html 17 18 * inspector/InspectorLayerTreeAgent.cpp: 19 (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Remove CompositingReasonBlending. 20 * rendering/RenderLayer.cpp: 21 (WebCore::RenderLayer::beginTransparencyLayers): Set the blendMode on the GraphicsContext. 22 * rendering/RenderLayer.h: paintsWithTransparency should return true when a blendMode is set. 23 * rendering/RenderLayerCompositor.cpp: Remove promotion code when a blendMode is detected. 24 (WebCore::RenderLayerCompositor::requiresCompositingLayer): Remove CompositingReasonBlending reason. 25 (WebCore::RenderLayerCompositor::requiresOwnBackingStore): Remove CompositingReasonBlending reason. 26 (WebCore::RenderLayerCompositor::reasonsForCompositing): Remove CompositingReasonBlending reason. 27 (WebCore::RenderLayerCompositor::logReasonsForCompositing): Remove CompositingReasonBlending reason. 28 * rendering/RenderLayerCompositor.h: 29 - Remove the requiresCompositingForBlending method 30 - Remove the CompositingReasonBlending from the CompositingReasons enum. 31 1 32 2014-02-11 Zalan Bujtas <zalan@apple.com> 2 33 -
trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
r163568 r163955 295 295 if (reasonsBitmask & CompositingReasonFilterWithCompositedDescendants) 296 296 compositingReasons->setFilterWithCompositedDescendants(true); 297 297 298 298 if (reasonsBitmask & CompositingReasonBlendingWithCompositedDescendants) 299 299 compositingReasons->setBlendingWithCompositedDescendants(true); … … 307 307 if (reasonsBitmask & CompositingReasonRoot) 308 308 compositingReasons->setRoot(true); 309 310 if (reasonsBitmask & CompositingReasonBlending)311 compositingReasons->setBlending(true);312 309 } 313 310 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r163944 r163955 1684 1684 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBehavior); 1685 1685 context->clip(clipRect); 1686 1687 #if ENABLE(CSS_COMPOSITING) 1688 if (hasBlendMode()) 1689 context->setCompositeOperation(context->compositeOperation(), m_blendMode); 1690 #endif 1691 1686 1692 context->beginTransparencyLayer(renderer().opacity()); 1693 1694 #if ENABLE(CSS_COMPOSITING) 1695 if (hasBlendMode()) 1696 context->setCompositeOperation(context->compositeOperation(), BlendModeNormal); 1697 #endif 1698 1687 1699 #ifdef REVEAL_TRANSPARENCY_LAYERS 1688 1700 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f), ColorSpaceDeviceRGB); -
trunk/Source/WebCore/rendering/RenderLayer.h
r163757 r163955 799 799 bool paintsWithTransparency(PaintBehavior paintBehavior) const 800 800 { 801 return isTransparent() && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());801 return (isTransparent() || hasBlendMode()) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited()); 802 802 } 803 803 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r163931 r163955 1990 1990 || requiresCompositingForScrolling(*renderer) 1991 1991 #endif 1992 || requiresCompositingForOverflowScrolling(*renderer->layer()) 1993 || requiresCompositingForBlending(*renderer); 1992 || requiresCompositingForOverflowScrolling(*renderer->layer()); 1994 1993 } 1995 1994 … … 2030 2029 || requiresCompositingForAnimation(renderer) 2031 2030 || requiresCompositingForFilters(renderer) 2032 || requiresCompositingForBlending(renderer)2033 2031 || requiresCompositingForPosition(renderer, layer) 2034 2032 || requiresCompositingForOverflowScrolling(layer) … … 2093 2091 if (requiresCompositingForFilters(*renderer)) 2094 2092 reasons |= CompositingReasonFilters; 2095 2096 if (requiresCompositingForBlending(*renderer))2097 reasons |= CompositingReasonBlending;2098 2093 2099 2094 if (requiresCompositingForPosition(*renderer, *renderer->layer())) … … 2129 2124 if (renderer->hasFilter()) 2130 2125 reasons |= CompositingReasonFilterWithCompositedDescendants; 2131 2126 2132 2127 if (renderer->hasBlendMode()) 2133 2128 reasons |= CompositingReasonBlendingWithCompositedDescendants; 2129 2134 2130 } else if (renderer->layer()->indirectCompositingReason() == RenderLayer::IndirectCompositingForPerspective) 2135 2131 reasons |= CompositingReasonPerspective; … … 2171 2167 if (reasons & CompositingReasonFilters) 2172 2168 return "filters"; 2173 2174 if (reasons & CompositingReasonBlending)2175 return "blending";2176 2169 2177 2170 if (reasons & CompositingReasonPositionFixed) … … 2442 2435 2443 2436 return renderer.hasFilter(); 2444 #else2445 UNUSED_PARAM(renderer);2446 return false;2447 #endif2448 }2449 2450 bool RenderLayerCompositor::requiresCompositingForBlending(RenderLayerModelObject& renderer) const2451 {2452 #if ENABLE(CSS_COMPOSITING)2453 return renderer.hasBlendMode();2454 2437 #else 2455 2438 UNUSED_PARAM(renderer); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r163931 r163955 81 81 CompositingReasonPerspective = 1 << 21, 82 82 CompositingReasonPreserve3D = 1 << 22, 83 CompositingReasonRoot = 1 << 23, 84 CompositingReasonBlending = 1 << 24 83 CompositingReasonRoot = 1 << 23 85 84 }; 86 85 typedef unsigned CompositingReasons; … … 394 393 bool requiresCompositingForFrame(RenderLayerModelObject&) const; 395 394 bool requiresCompositingForFilters(RenderLayerModelObject&) const; 396 bool requiresCompositingForBlending(RenderLayerModelObject&) const;397 395 bool requiresCompositingForScrollableFrame() const; 398 396 bool requiresCompositingForPosition(RenderLayerModelObject&, const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
Note: See TracChangeset
for help on using the changeset viewer.