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

Unified Diff: cc/layer_tree_host_common.cc

Issue 11929045: cc: DelegatedRenderer layer needs a surface if rotated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698