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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2878743002: Set opacity and transform mutations directly on property tree for SPv2. (Closed)
Patch Set: Sync to head and share test logic. Created 3 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 | « no previous file | cc/trees/layer_tree_host_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.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 7402ea2a808697928a1a96edc44562b899aa6efc..320dd018cf7c24bcf34f2bd4d27e8a9fee89d7ae 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1278,10 +1278,16 @@ void LayerTreeHost::SetElementFilterMutated(ElementId element_id,
void LayerTreeHost::SetElementOpacityMutated(ElementId element_id,
ElementListType list_type,
float opacity) {
- Layer* layer = LayerByElementId(element_id);
- DCHECK(layer);
DCHECK_GE(opacity, 0.f);
DCHECK_LE(opacity, 1.f);
+
+ if (settings_.use_layer_lists) {
+ property_trees_.effect_tree.OnOpacityAnimated(element_id, opacity);
+ return;
+ }
+
+ Layer* layer = LayerByElementId(element_id);
+ DCHECK(layer);
layer->OnOpacityAnimated(opacity);
if (EffectNode* node =
@@ -1302,6 +1308,11 @@ void LayerTreeHost::SetElementTransformMutated(
ElementId element_id,
ElementListType list_type,
const gfx::Transform& transform) {
+ if (settings_.use_layer_lists) {
+ property_trees_.transform_tree.OnTransformAnimated(element_id, transform);
+ return;
+ }
+
Layer* layer = LayerByElementId(element_id);
DCHECK(layer);
layer->OnTransformAnimated(transform);
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698