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

Side by Side Diff: cc/trees/property_tree_builder.cc

Issue 2105673003: cc: Compute animation scale on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit changes Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « cc/trees/property_tree.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/property_tree_builder.h" 5 #include "cc/trees/property_tree_builder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 node->id, data_for_children->property_trees->effect_tree 551 node->id, data_for_children->property_trees->effect_tree
552 .Node(data_for_children->render_target) 552 .Node(data_for_children->render_target)
553 ->data.transform_id); 553 ->data.transform_id);
554 DCHECK_NE( 554 DCHECK_NE(
555 data_for_children->property_trees->transform_tree.TargetId(node->id), 555 data_for_children->property_trees->transform_tree.TargetId(node->id),
556 kInvalidPropertyTreeNodeId); 556 kInvalidPropertyTreeNodeId);
557 557
558 node->data.has_potential_animation = has_potentially_animated_transform; 558 node->data.has_potential_animation = has_potentially_animated_transform;
559 node->data.is_currently_animating = layer->TransformIsAnimating(); 559 node->data.is_currently_animating = layer->TransformIsAnimating();
560 if (has_potentially_animated_transform) { 560 if (has_potentially_animated_transform) {
561 float maximum_animation_target_scale = 0.f;
562 if (layer->MaximumTargetScale(&maximum_animation_target_scale)) {
563 node->data.local_maximum_animation_target_scale =
564 maximum_animation_target_scale;
565 }
566
567 float starting_animation_scale = 0.f;
568 if (layer->AnimationStartScale(&starting_animation_scale)) {
569 node->data.local_starting_animation_scale = starting_animation_scale;
570 }
571
572 node->data.has_only_translation_animations = 561 node->data.has_only_translation_animations =
573 layer->HasOnlyTranslationTransforms(); 562 layer->HasOnlyTranslationTransforms();
574 } 563 }
575 564
576 float post_local_scale_factor = 1.0f; 565 float post_local_scale_factor = 1.0f;
577 if (is_root) 566 if (is_root)
578 post_local_scale_factor = 567 post_local_scale_factor =
579 data_for_children->property_trees->transform_tree.device_scale_factor(); 568 data_for_children->property_trees->transform_tree.device_scale_factor();
580 569
581 if (is_page_scale_layer) { 570 if (is_page_scale_layer) {
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 property_trees->is_main_thread = false; 1375 property_trees->is_main_thread = false;
1387 property_trees->is_active = root_layer->IsActive(); 1376 property_trees->is_active = root_layer->IsActive();
1388 SkColor color = root_layer->layer_tree_impl()->background_color(); 1377 SkColor color = root_layer->layer_tree_impl()->background_color();
1389 if (SkColorGetA(color) != 255) 1378 if (SkColorGetA(color) != 255)
1390 color = SkColorSetA(color, 255); 1379 color = SkColorSetA(color, 255);
1391 BuildPropertyTreesTopLevelInternal( 1380 BuildPropertyTreesTopLevelInternal(
1392 root_layer, page_scale_layer, inner_viewport_scroll_layer, 1381 root_layer, page_scale_layer, inner_viewport_scroll_layer,
1393 outer_viewport_scroll_layer, overscroll_elasticity_layer, 1382 outer_viewport_scroll_layer, overscroll_elasticity_layer,
1394 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, 1383 elastic_overscroll, page_scale_factor, device_scale_factor, viewport,
1395 device_transform, property_trees, color); 1384 device_transform, property_trees, color);
1385 property_trees->ResetCachedData();
1396 } 1386 }
1397 1387
1398 } // namespace cc 1388 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698