Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1463)

Unified Diff: Source/core/rendering/CompositedLayerMapping.cpp

Issue 23511004: mix-blend-mode implementation for accelerated layers - blink part (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp
index 1beb7cc164262f6339bd2d03b1cfc88dbb9bae0d..547ef946ccc0d3ee8cef87ddfb444a5de904b2b8 100644
--- a/Source/core/rendering/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/CompositedLayerMapping.cpp
@@ -211,8 +211,10 @@ void CompositedLayerMapping::createPrimaryGraphicsLayer()
updateTransform(renderer()->style());
updateFilters(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
+ if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
updateLayerBlendMode(renderer()->style());
+ updateIsRootForIsolatedGroup();
+ }
}
void CompositedLayerMapping::destroyGraphicsLayers()
@@ -269,8 +271,19 @@ void CompositedLayerMapping::updateFilters(const RenderStyle* style)
}
}
-void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle*)
+void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle* style)
{
+ setBlendMode(style->blendMode());
+}
+
+void CompositedLayerMapping::updateIsRootForIsolatedGroup()
+{
+ bool isolate = m_owningLayer->shouldIsolateCompositedDescendants();
+
+ // non stacking context layers should never isolate
+ ASSERT(m_owningLayer->stackingNode()->isStackingContext() || !isolate);
+
+ m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
}
void CompositedLayerMapping::updateContentsOpaque()
@@ -522,8 +535,10 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
if (!renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
updateOpacity(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
+ if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
shawnsingh 2013/11/23 00:38:13 I think it would be equivalent to move these down
rosca 2013/11/25 21:11:41 It should be the same. Done.
updateLayerBlendMode(renderer()->style());
+ updateIsRootForIsolatedGroup();
+ }
bool isSimpleContainer = isSimpleContainerCompositingLayer();
@@ -1586,8 +1601,15 @@ void CompositedLayerMapping::paintsIntoCompositedAncestorChanged()
compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
}
-void CompositedLayerMapping::setBlendMode(BlendMode)
+void CompositedLayerMapping::setBlendMode(BlendMode blendMode)
{
+ if (m_ancestorClippingLayer) {
shawnsingh 2013/11/23 00:38:13 lately we are adding more layers in the Composited
rosca 2013/11/25 21:11:41 The same approach is used by scrolling coordinator
+ ASSERT(childForSuperlayers() == m_ancestorClippingLayer.get());
+ m_graphicsLayer->setBlendMode(BlendModeNormal);
+ } else {
+ ASSERT(childForSuperlayers() == m_graphicsLayer.get());
+ }
+ childForSuperlayers()->setBlendMode(blendMode);
}
void CompositedLayerMapping::setContentsNeedDisplay()

Powered by Google App Engine
This is Rietveld 408576698