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

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: Renamed a variable 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 92c923734c556bd8ba93e3ac8b9ceaade988306e..694a62d76190926f87089d6355082df34d8440fc 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,16 @@ void CompositedLayerMapping::updateFilters(const RenderStyle* style)
}
}
-void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle*)
+void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle* style)
+{
+ setBlendMode(style->blendMode());
+}
+
+void CompositedLayerMapping::updateIsRootForIsolatedGroup()
{
+ m_graphicsLayer->setIsRootForIsolatedGroup(
+ m_owningLayer->requiresIsolationForCompositedStackingContext()
+ && m_owningLayer->stackingNode()->isStackingContext());
}
void CompositedLayerMapping::updateContentsOpaque()
@@ -522,8 +532,10 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
if (!renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
updateOpacity(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
+ if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
updateLayerBlendMode(renderer()->style());
+ updateIsRootForIsolatedGroup();
+ }
bool isSimpleContainer = isSimpleContainerCompositingLayer();
@@ -1586,8 +1598,15 @@ void CompositedLayerMapping::paintsIntoCompositedAncestorChanged()
compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
}
-void CompositedLayerMapping::setBlendMode(BlendMode)
+void CompositedLayerMapping::setBlendMode(BlendMode blendMode)
{
+ if (m_ancestorClippingLayer) {
+ 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