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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2018833002: cc : Delete LayerImpl::opacity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 6b9f8e946527278603c1c4cab5cd5d5d4148a75d..f131fe8ec881c6112a7aa03d61cca195357d67d1 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -615,7 +615,8 @@ static inline bool HasPotentialOpacityAnimation(Layer* layer) {
}
static inline bool HasPotentialOpacityAnimation(LayerImpl* layer) {
- return layer->HasPotentiallyRunningOpacityAnimation();
+ return layer->HasPotentiallyRunningOpacityAnimation() ||
+ layer->test_properties()->opacity_can_animate;
}
static inline bool DoubleSided(Layer* layer) {
@@ -662,8 +663,17 @@ static inline float EffectiveOpacity(Layer* layer) {
}
static inline float EffectiveOpacity(LayerImpl* layer) {
- return layer->test_properties()->hide_layer_and_subtree ? 0.f
- : layer->opacity();
+ return layer->test_properties()->hide_layer_and_subtree
+ ? 0.f
+ : layer->test_properties()->opacity;
+}
+
+static inline float Opacity(Layer* layer) {
+ return layer->opacity();
+}
+
+static inline float Opacity(LayerImpl* layer) {
+ return layer->test_properties()->opacity;
}
static inline bool HideLayerAndSubtree(Layer* layer) {
@@ -846,7 +856,7 @@ bool AddEffectNodeIfNeeded(
.push_back(node.owner_id);
}
- node.data.opacity = layer->opacity();
+ node.data.opacity = Opacity(layer);
node.data.has_render_surface = should_create_render_surface;
node.data.has_copy_request = HasCopyRequest(layer);
node.data.has_background_filters = !layer->background_filters().IsEmpty();
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698