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

Side by Side Diff: Source/core/rendering/compositing/CompositingLayerAssigner.cpp

Issue 277763002: Prevent squashing into your own compositing container (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix whitespace nit Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/compositing/squashing/attempting-to-squash-into-compositing-container-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) 126 if (squashingWouldExceedSparsityTolerance(layer, squashingState))
127 return false; 127 return false;
128 128
129 // FIXME: this is not efficient, since it walks up the tree . We should stor e these values on the AncestorDependentPropertiesCache. 129 // FIXME: this is not efficient, since it walks up the tree . We should stor e these values on the AncestorDependentPropertiesCache.
130 ASSERT(squashingState.hasMostRecentMapping); 130 ASSERT(squashingState.hasMostRecentMapping);
131 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning Layer(); 131 const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owning Layer();
132 132
133 if (layer->renderer()->clippingContainer() != squashingLayer.renderer()->cli ppingContainer()) 133 if (layer->renderer()->clippingContainer() != squashingLayer.renderer()->cli ppingContainer())
134 return false; 134 return false;
135 135
136 if (layer->compositingContainer() == &squashingLayer)
137 return false;
138
136 // Composited descendants need to be clipped by a child contianment graphics layer, which would not be available if the layer is 139 // Composited descendants need to be clipped by a child contianment graphics layer, which would not be available if the layer is
137 if (m_compositor->clipsCompositingDescendants(layer)) 140 if (m_compositor->clipsCompositingDescendants(layer))
138 return false; 141 return false;
139 142
140 if (layer->scrollsWithRespectTo(&squashingLayer)) 143 if (layer->scrollsWithRespectTo(&squashingLayer))
141 return false; 144 return false;
142 145
143 const RenderLayer::AncestorDependentProperties& ancestorDependentProperties = layer->ancestorDependentProperties(); 146 const RenderLayer::AncestorDependentProperties& ancestorDependentProperties = layer->ancestorDependentProperties();
144 const RenderLayer::AncestorDependentProperties& squashingLayerAncestorDepend entProperties = squashingLayer.ancestorDependentProperties(); 147 const RenderLayer::AncestorDependentProperties& squashingLayerAncestorDepend entProperties = squashingLayer.ancestorDependentProperties();
145 148
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 squashingState.updateSquashingStateForNewMapping(layer->compositedLa yerMapping(), layer->hasCompositedLayerMapping(), offsetFromTransformedAncestorF orSquashingCLM); 274 squashingState.updateSquashingStateForNewMapping(layer->compositedLa yerMapping(), layer->hasCompositedLayerMapping(), offsetFromTransformedAncestorF orSquashingCLM);
272 } 275 }
273 } 276 }
274 277
275 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC hildren | PositiveZOrderChildren); 278 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC hildren | PositiveZOrderChildren);
276 while (RenderLayerStackingNode* curNode = iterator.next()) 279 while (RenderLayerStackingNode* curNode = iterator.next())
277 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC hanged); 280 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC hanged);
278 } 281 }
279 282
280 } 283 }
OLDNEW
« no previous file with comments | « LayoutTests/compositing/squashing/attempting-to-squash-into-compositing-container-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698