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

Unified Diff: cc/layer_tree_host_common.cc

Issue 11567034: Changes subtreeShouldRenderToSeparateSurface logic to account for explicit clipping (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moving IsPositiveScaleOrTranslation into gfx::Transform Created 8 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
Index: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index 0a204ceb6914df96a5bdede2b6c8c9ee7e1c6915..90bc1c9228c41ad3e75be70db7a57d9f73b0bc42 100644
--- a/cc/layer_tree_host_common.cc
+++ b/cc/layer_tree_host_common.cc
@@ -274,7 +274,7 @@ static bool subtreeShouldRenderToSeparateSurface(LayerType* layer, bool axisAlig
return true;
// If the layer clips its descendants but it is not axis-aligned with respect to its parent.
- if (layerClipsSubtree(layer) && !axisAlignedWithRespectToParent && numDescendantsThatDrawContent > 0)
+ if (layerClipsSubtree(layer) && !axisAlignedWithRespectToParent && !layer->drawProperties().can_clip_self)
danakj 2012/12/15 18:49:12 Why doesn't a layer need to know that all layers i
return true;
// If the layer has some translucency and does not have a preserves-3d transform style.
@@ -435,15 +435,25 @@ template<typename LayerType>
static void preCalculateMetaInformation(LayerType* layer)
{
int numDescendantsThatDrawContent = 0;
+ bool canClipSelf = true;
danakj 2012/12/15 18:49:12 Why isn't this initialized to the return for the c
+ bool sublayerXformPreventsClip = !layer->sublayerTransform().IsPositiveScaleOrTranslation();
for (size_t i = 0; i < layer->children().size(); ++i) {
LayerType* childLayer = layer->children()[i];
preCalculateMetaInformation<LayerType>(childLayer);
+
numDescendantsThatDrawContent += childLayer->drawsContent() ? 1 : 0;
numDescendantsThatDrawContent += childLayer->drawProperties().num_descendants_that_draw_content;
+
+ if ((childLayer->drawsContent() && !childLayer->canClipSelf()) ||
+ !childLayer->drawProperties().can_clip_self ||
+ sublayerXformPreventsClip ||
+ !childLayer->transform().IsPositiveScaleOrTranslation())
+ canClipSelf = false;
}
layer->drawProperties().num_descendants_that_draw_content = numDescendantsThatDrawContent;
+ layer->drawProperties().can_clip_self = canClipSelf;
}
// Recursively walks the layer tree starting at the given node and computes all the

Powered by Google App Engine
This is Rietveld 408576698