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

Unified Diff: Source/core/rendering/RenderLayerCompositor.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/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index f2b31f68b7129e01433a48b355d31b0568dc9a4b..ef8ec7c77136ec8f9662d1d2e42b1086e098a491 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -177,6 +177,7 @@ struct CompositingRecursionData {
CompositingRecursionData(RenderLayer* compAncestor, bool testOverlap)
: m_compositingAncestor(compAncestor)
, m_subtreeIsCompositing(false)
+ , m_hasUnisolatedCompositedBlendingDescendant(false)
, m_testingOverlap(testOverlap)
#ifndef NDEBUG
, m_depth(0)
@@ -187,6 +188,7 @@ struct CompositingRecursionData {
CompositingRecursionData(const CompositingRecursionData& other)
: m_compositingAncestor(other.m_compositingAncestor)
, m_subtreeIsCompositing(other.m_subtreeIsCompositing)
+ , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompositedBlendingDescendant)
, m_testingOverlap(other.m_testingOverlap)
#ifndef NDEBUG
, m_depth(other.m_depth + 1)
@@ -196,6 +198,7 @@ struct CompositingRecursionData {
RenderLayer* m_compositingAncestor;
bool m_subtreeIsCompositing;
+ bool m_hasUnisolatedCompositedBlendingDescendant;
bool m_testingOverlap;
#ifndef NDEBUG
int m_depth;
@@ -907,6 +910,11 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
if (overlapMap && childRecursionData.m_compositingAncestor && !childRecursionData.m_compositingAncestor->isRootLayer())
addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
+ if (layer->stackingNode()->isStackingContext())
+ layer->setShouldIsolateCompositedDescendants(childRecursionData.m_hasUnisolatedCompositedBlendingDescendant);
+ else
+ currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = childRecursionData.m_hasUnisolatedCompositedBlendingDescendant;
+
// Now check for reasons to become composited that depend on the state of descendant layers.
CompositingReasons subtreeCompositingReasons = subtreeReasonsForCompositing(layer->renderer(), childRecursionData.m_subtreeIsCompositing, anyDescendantHas3DTransform);
reasonsToComposite |= subtreeCompositingReasons;
@@ -933,6 +941,9 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
if (childRecursionData.m_subtreeIsCompositing)
currentRecursionData.m_subtreeIsCompositing = true;
+ if (willBeComposited && layer->hasBlendMode())
+ currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true;
+
// Set the flag to say that this SC has compositing children.
layer->setHasCompositingDescendant(childRecursionData.m_subtreeIsCompositing);
@@ -1708,6 +1719,11 @@ CompositingReasons RenderLayerCompositor::subtreeReasonsForCompositing(RenderObj
if (layer->transform())
subtreeReasons |= CompositingReasonTransformWithCompositedDescendants;
+ if (layer->shouldIsolateCompositedDescendants()) {
+ ASSERT(layer->stackingNode()->isStackingContext());
+ subtreeReasons |= CompositingReasonIsolateCompositedDescendants;
+ }
+
// If the implementation of createsGroup changes, we need to be aware of that in this part of code.
ASSERT((renderer->isTransparent() || renderer->hasMask() || renderer->hasFilter() || renderer->hasBlendMode()) == renderer->createsGroup());
if (renderer->isTransparent())

Powered by Google App Engine
This is Rietveld 408576698