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

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: SetIsDrawable on the new cc_layer 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..f4c64f92faf5c0abc31a7eaca615312d918b4b85 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.
@@ -1491,6 +1499,7 @@ static void CalculateDrawPropertiesInternal(
}
UpdateTilePrioritiesForLayer(layer);
+ SavePaintPropertiesLayer(layer);
// If neither this layer nor any of its children were added, early out.
if (sorting_start_index == descendants.size())
@@ -1518,8 +1527,6 @@ static void CalculateDrawPropertiesInternal(
layer->render_target()->render_surface()->
AddContributingDelegatedRenderPassLayer(layer);
}
-
- SavePaintPropertiesLayer(layer);
}
void LayerTreeHostCommon::CalculateDrawProperties(
« 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