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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 16896017: Add a hide_layer_and_subtree() flag to cc::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hide-subtree-flag: Created 7 years, 6 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/layers/layer_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 2e3d8402c7e9b078b10c796afc2854732626df35..4a616eb942bc450f875cabda5b1cde8db7a21d1f 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -232,6 +232,10 @@ static bool LayerShouldBeSkipped(LayerType* layer) {
}
static inline bool SubtreeShouldBeSkipped(LayerImpl* layer) {
+ // The embedder can request to hide the entire layer's subtree.
+ if (layer->hide_layer_and_subtree())
+ return true;
+
// If layer is on the pending tree and opacity is being animated then
// this subtree can't be skipped as we need to create, prioritize and
// include tiles for this layer when deciding if tree can be activated.
@@ -245,6 +249,10 @@ static inline bool SubtreeShouldBeSkipped(LayerImpl* layer) {
}
static inline bool SubtreeShouldBeSkipped(Layer* layer) {
+ // The embedder can request to hide the entire layer's subtree.
+ if (layer->hide_layer_and_subtree())
+ return true;
+
// If the opacity is being animated then the opacity on the main thread is
// unreliable (since the impl thread may be using a different opacity), so it
// should not be trusted.
@@ -1493,7 +1501,7 @@ static void CalculateDrawPropertiesInternal(
UpdateTilePrioritiesForLayer(layer);
// If neither this layer nor any of its children were added, early out.
- if (sorting_start_index == descendants.size())
+ if (!IsRootLayer(layer) && sorting_start_index == descendants.size())
enne (OOO) 2013/06/20 00:17:47 If the root layer doesn't draw, why does it need t
danakj 2013/06/20 00:20:04 Because otherwise the impl layer doesn't get the r
return;
// If preserves-3d then sort all the descendants in 3D so that they can be
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698