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

Unified Diff: Source/core/rendering/compositing/CompositingLayerAssigner.cpp

Issue 331203003: Improve the compositing reasons when squashing fails (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 6 months 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/compositing/CompositingLayerAssigner.cpp
diff --git a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
index 356ecfdb6d426e5d2e70332dbb86b9d6750d8108..c9dd66a2b6ce69217a231f5af49be801298eb82e 100644
--- a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
+++ b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
@@ -111,10 +111,10 @@ CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerU
return update;
}
-bool CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner(const RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
+CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
{
if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree)
- return false;
+ return CompositingReasonSquashingWouldBreakPaintOrder;
// FIXME: this special case for video exists only to deal with corner cases
// where a RenderVideo does not report that it needs to be directly composited.
@@ -125,10 +125,10 @@ bool CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner(const RenderLa
// compositing/video/video-controls-layer-creation.html
// virtual/softwarecompositing/video/video-controls-layer-creation.html
if (layer->renderer()->isVideo())
- return false;
+ return CompositingReasonSquashingVideoIsDisallowed;
if (squashingWouldExceedSparsityTolerance(layer, squashingState))
- return false;
+ return CompositingReasonSquashingSparsityExceeded;
// FIXME: this is not efficient, since it walks up the tree . We should store these values on the CompositingInputsCache.
ASSERT(squashingState.hasMostRecentMapping);
@@ -136,29 +136,30 @@ bool CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner(const RenderLa
if (layer->renderer()->clippingContainer() != squashingLayer.renderer()->clippingContainer()) {
if (!squashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->renderer()->clippingContainer()))
- return false;
+ return CompositingReasonSquashingClippingContainerMismatch;
}
- // Composited descendants need to be clipped by a child contianment graphics layer, which would not be available if the layer is
+ // Composited descendants need to be clipped by a child containment graphics layer, which would not be available if the layer is
+ // squashed (and therefore has no CLM nor a child containment graphics layer).
if (m_compositor->clipsCompositingDescendants(layer))
- return false;
+ return CompositingReasonSquashedLayerClipsCompositingDescendants;
if (layer->scrollsWithRespectTo(&squashingLayer))
- return false;
+ return CompositingReasonScrollsWithRespectToSquashingLayer;
const RenderLayer::CompositingInputs& compositingInputs = layer->compositingInputs();
const RenderLayer::CompositingInputs& squashingLayerCompositingInputs = squashingLayer.compositingInputs();
if (compositingInputs.opacityAncestor != squashingLayerCompositingInputs.opacityAncestor)
- return false;
+ return CompositingReasonSquashingOpacityAncestorMismatch;
if (compositingInputs.transformAncestor != squashingLayerCompositingInputs.transformAncestor)
- return false;
+ return CompositingReasonSquashingTransformAncestorMismatch;
if (compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor)
- return false;
+ return CompositingReasonSquashingFilterAncestorMismatch;
- return true;
+ return CompositingReasonNone;
}
bool CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate,
@@ -222,8 +223,11 @@ void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLa
void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, bool& layersChanged, Vector<RenderLayer*>& layersNeedingRepaint)
{
- if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons()) && !canSquashIntoCurrentSquashingOwner(layer, squashingState))
- layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonNoSquashingTargetFound);
+ if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons())) {
+ CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
+ if (reasonsPreventingSquashing)
+ layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing);
+ }
CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
« no previous file with comments | « Source/core/rendering/compositing/CompositingLayerAssigner.h ('k') | Source/platform/graphics/CompositingReasons.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698