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

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: 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 536a35118a5c0041305fe0dc71df3395a7ec08f9..9d3d4f54b2a777a443e60211bd90ca9f67f7552b 100644
--- a/Source/core/rendering/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/CompositedLayerMapping.cpp
@@ -213,8 +213,10 @@ void CompositedLayerMapping::createPrimaryGraphicsLayer()
updateTransform(renderer()->style());
updateFilters(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
+ if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
updateLayerBlendMode(renderer()->style());
+ updateIsRootForIsolatedGroup();
+ }
}
void CompositedLayerMapping::destroyGraphicsLayers()
@@ -271,8 +273,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()
@@ -532,9 +545,6 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
: !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
updateOpacity(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
- updateLayerBlendMode(renderer()->style());
-
bool isSimpleContainer = isSimpleContainerCompositingLayer();
m_owningLayer->updateDescendantDependentFlags();
@@ -782,6 +792,11 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
// since it depends on whether compAncestor draws content, which gets updated later.
updateRequiresOwnBackingStoreForAncestorReasons(compAncestor);
+ if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
+ updateLayerBlendMode(style);
+ updateIsRootForIsolatedGroup();
+ }
+
updateContentsRect(isSimpleContainer);
updateBackgroundColor(isSimpleContainer);
updateDrawsContent(isSimpleContainer);
@@ -1590,8 +1605,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