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

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: removed a failing reftest dependent on render-compositor bindings Created 7 years 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
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.h ('k') | Source/core/rendering/CompositingReasons.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp
index 8a1fae7e67f12370dffa5a5090dae4d4909e4d68..d60ab34e3c0bb51be192e48ea32396eba3ce5ab7 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()
@@ -537,9 +550,6 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
: !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
updateOpacity(renderer()->style());
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
- updateLayerBlendMode(renderer()->style());
-
bool isSimpleContainer = isSimpleContainerCompositingLayer();
m_owningLayer->updateDescendantDependentFlags();
@@ -787,6 +797,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);
@@ -1589,8 +1604,15 @@ void CompositedLayerMapping::paintsIntoCompositedAncestorChanged()
compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
}
-void CompositedLayerMapping::setBlendMode(blink::WebBlendMode)
+void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
{
+ if (m_ancestorClippingLayer) {
+ ASSERT(childForSuperlayers() == m_ancestorClippingLayer.get());
+ m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal);
+ } else {
+ ASSERT(childForSuperlayers() == m_graphicsLayer.get());
+ }
+ childForSuperlayers()->setBlendMode(blendMode);
}
void CompositedLayerMapping::setContentsNeedDisplay()
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.h ('k') | Source/core/rendering/CompositingReasons.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698