Chromium Code Reviews| Index: Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp |
| diff --git a/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp b/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp |
| index cb11a721f59b49073306b59b5ea4be623bd6f3a5..dcd766e1a0e933a1b171661ad264c80f686d6518 100644 |
| --- a/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp |
| +++ b/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp |
| @@ -163,6 +163,7 @@ public: |
| , m_subtreeIsCompositing(false) |
| , m_hasUnisolatedCompositedBlendingDescendant(false) |
| , m_testingOverlap(testOverlap) |
| + , m_suppressLayerCreation(false) |
| #ifndef NDEBUG |
| , m_depth(0) |
| #endif |
| @@ -175,6 +176,7 @@ public: |
| , m_subtreeIsCompositing(other.m_subtreeIsCompositing) |
| , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompositedBlendingDescendant) |
| , m_testingOverlap(other.m_testingOverlap) |
| + , m_suppressLayerCreation(other.m_suppressLayerCreation) |
| #ifndef NDEBUG |
| , m_depth(other.m_depth + 1) |
| #endif |
| @@ -186,6 +188,7 @@ public: |
| bool m_subtreeIsCompositing; |
| bool m_hasUnisolatedCompositedBlendingDescendant; |
| bool m_testingOverlap; |
| + bool m_suppressLayerCreation; |
| #ifndef NDEBUG |
| int m_depth; |
| #endif |
| @@ -201,6 +204,11 @@ static bool requiresCompositingOrSquashing(CompositingReasons reasons) |
| return reasons != CompositingReasonNone; |
| } |
| +static bool shouldMakeDescendantsSuppressCompositedLayerCreation(CompositingReasons reasons) |
| +{ |
| + return reasons & CompositingReasonWillChangeGpuRasterizationHint; |
| +} |
| + |
| static CompositingReasons subtreeReasonsForCompositing(RenderObject* renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants) |
| { |
| CompositingReasons subtreeReasons = CompositingReasonNone; |
| @@ -286,12 +294,18 @@ void CompositingRequirementsUpdater::updateRecursive(RenderLayer* ancestorLayer, |
| layer->stackingNode()->updateLayerListsIfNeeded(); |
| + bool needToRecomputeStyleReasons = layer->suppressingCompositedLayerCreation() != currentRecursionData.m_suppressLayerCreation; |
| + layer->setSuppressingCompositedLayerCreation(currentRecursionData.m_suppressLayerCreation); |
|
abarth-chromium
2014/04/14 20:29:53
Why is this a property of the RenderLayer? It see
ajuma
2014/04/15 19:11:34
As long as we continue to have incremental composi
|
| + |
| // Clear the flag |
| layer->setHasCompositingDescendant(false); |
| // Start by assuming this layer will not need to composite. |
| CompositingReasons reasonsToComposite = CompositingReasonNone; |
| + if (needToRecomputeStyleReasons) |
|
abarth-chromium
2014/04/14 20:29:53
There's no such thing as a need to recompute style
ajuma
2014/04/15 19:11:34
Fixed. Instead of mutating style-determined reason
|
| + compositor->updateStyleDeterminedCompositingReasons(layer); |
| + |
| // First accumulate the straightforward compositing reasons. |
| CompositingReasons directReasons = m_compositingReasonFinder.directReasons(layer, m_needsToRecomputeCompositingRequirements); |
| @@ -348,6 +362,7 @@ void CompositingRequirementsUpdater::updateRecursive(RenderLayer* ancestorLayer, |
| // ancestor with m_subtreeIsCompositing set to false. |
| RecursionData childRecursionData(currentRecursionData); |
| childRecursionData.m_subtreeIsCompositing = false; |
| + childRecursionData.m_suppressLayerCreation = layer->suppressingCompositedLayerCreation() || shouldMakeDescendantsSuppressCompositedLayerCreation(directReasons); |
| bool willBeCompositedOrSquashed = compositor->canBeComposited(layer) && requiresCompositingOrSquashing(reasonsToComposite); |
| if (willBeCompositedOrSquashed) { |