Index: cc/layer_tree_host_common.cc |
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc |
index 5746dde48523e81f92ddd34f97fe2486988c907a..f4bf6341ad4f770176ff0528278fcdb6921a3f53 100644 |
--- a/cc/layer_tree_host_common.cc |
+++ b/cc/layer_tree_host_common.cc |
@@ -132,7 +132,7 @@ static bool isSurfaceBackFaceVisible(LayerType* layer, const gfx::Transform& dra |
template<typename LayerType> |
static inline bool layerClipsSubtree(LayerType* layer) |
{ |
- return layer->masksToBounds() || layer->maskLayer(); |
+ return layer->masksToBounds() || layer->maskLayer() || layer->hasDelegatedContent(); |
piman
2013/01/19 02:39:09
I wonder if this could have a bad side effect if w
danakj
2013/01/19 02:43:00
In my mind the DRLayer should never have any child
|
} |
template<typename LayerType> |
@@ -302,8 +302,7 @@ static bool subtreeShouldRenderToSeparateSurface(LayerType* layer, bool axisAlig |
// subtree overlap. But checking layer overlaps is unnecessarily costly so |
// instead we conservatively create a surface whenever at least two layers |
// draw content for this subtree. |
- bool atLeastTwoLayersInSubtreeDrawContent = layer->hasDelegatedContent() || |
- (numDescendantsThatDrawContent > 0 && (layer->drawsContent() || numDescendantsThatDrawContent > 1)); |
+ bool atLeastTwoLayersInSubtreeDrawContent = numDescendantsThatDrawContent > 0 && (layer->drawsContent() || numDescendantsThatDrawContent > 1); |
if (layer->opacity() != 1 && !layer->preserves3D() && atLeastTwoLayersInSubtreeDrawContent) { |
TRACE_EVENT_INSTANT0("cc", "LayerTreeHostCommon::requireSurface opacity"); |
@@ -495,6 +494,15 @@ static inline void removeSurfaceForEarlyExit(LayerType* layerToRemove, LayerList |
template<typename LayerType> |
static void preCalculateMetaInformation(LayerType* layer) |
{ |
+ if (layer->hasDelegatedContent()) { |
+ // Layers with delegated content need to be treated as if they have as many children as the number |
+ // of layers they own delegated quads for. Since we don't know this number right now, we choose |
+ // one that acts like infinity for our purposes. |
+ layer->drawProperties().num_descendants_that_draw_content = 1000; |
+ layer->drawProperties().descendants_can_clip_selves = false; |
+ return; |
+ } |
+ |
int numDescendantsThatDrawContent = 0; |
bool descendantsCanClipSelves = true; |
bool sublayerTransformPreventsClip = !layer->sublayerTransform().IsPositiveScaleOrTranslation(); |