summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_common.cc
diff options
context:
space:
mode:
authorjaydasika <jaydasika@chromium.org>2016-03-23 18:26:05 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 01:27:58 +0000
commit0c2fd47d62aba824e36bc78560f8c9d4288a30dd (patch)
tree6f9e5025bd9dd55da00b2067de568a897b311770 /cc/trees/layer_tree_host_common.cc
parenteb0d622c183ae08eb51e1ca68b84cbb16c564363 (diff)
downloadchromium_src-0c2fd47d62aba824e36bc78560f8c9d4288a30dd.zip
chromium_src-0c2fd47d62aba824e36bc78560f8c9d4288a30dd.tar.gz
chromium_src-0c2fd47d62aba824e36bc78560f8c9d4288a30dd.tar.bz2
cc : Determine if a layer is root by using the value in LayerTreeImpl
This CL also makes ValidateRenderSurfaces in DrawPropertyUtils use Layer Iterator. BUG=594024,568794 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1832663002 Cr-Commit-Position: refs/heads/master@{#383005}
Diffstat (limited to 'cc/trees/layer_tree_host_common.cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 77b327b..143969b 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -243,11 +243,14 @@ gfx::Rect LayerTreeHostCommon::CalculateVisibleRect(
target_surface_rect, layer_bound_rect, layer_in_surface_space, transform);
}
-template <typename LayerType>
-static inline bool IsRootLayer(LayerType* layer) {
+static inline bool IsRootLayer(const Layer* layer) {
return !layer->parent();
}
+static inline bool IsRootLayer(const LayerImpl* layer) {
+ return layer->layer_tree_impl()->IsRootLayer(layer);
+}
+
template <typename LayerType>
static inline bool LayerIsInExisting3DRenderingContext(LayerType* layer) {
return layer->Is3dSorted() && layer->parent() &&
@@ -321,7 +324,7 @@ static bool LayerShouldBeSkipped(LayerImpl* layer,
LayerImpl* backface_test_layer = layer;
if (layer->use_parent_backface_visibility()) {
- DCHECK(layer->parent());
+ DCHECK(!IsRootLayer(layer));
DCHECK(!layer->parent()->use_parent_backface_visibility());
backface_test_layer = layer->parent();
}
@@ -710,7 +713,7 @@ void CalculateRenderTarget(LayerImpl* layer,
layer;
} else {
- DCHECK(layer->parent());
+ DCHECK(!IsRootLayer(layer));
layer->draw_properties().render_target = layer->parent()->render_target();
}