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

Side by Side Diff: cc/layers/layer.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/layers/draw_properties.cc ('k') | cc/layers/layer_impl.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, 1708 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM,
1709 id())) 1709 id()))
1710 return; 1710 return;
1711 DCHECK_EQ(transform_tree_index(), 1711 DCHECK_EQ(transform_tree_index(),
1712 property_trees->transform_id_to_index_map[id()]); 1712 property_trees->transform_id_to_index_map[id()]);
1713 TransformNode* node = 1713 TransformNode* node =
1714 property_trees->transform_tree.Node(transform_tree_index()); 1714 property_trees->transform_tree.Node(transform_tree_index());
1715 1715
1716 node->data.has_potential_animation = has_potential_animation; 1716 node->data.has_potential_animation = has_potential_animation;
1717 if (has_potential_animation) { 1717 if (has_potential_animation) {
1718 float maximum_target_scale = 0.f;
1719 node->data.local_maximum_animation_target_scale =
1720 MaximumTargetScale(&maximum_target_scale) ? maximum_target_scale : 0.f;
1721
1722 float animation_start_scale = 0.f;
1723 node->data.local_starting_animation_scale =
1724 AnimationStartScale(&animation_start_scale) ? animation_start_scale
1725 : 0.f;
1726
1727 node->data.has_only_translation_animations = HasOnlyTranslationTransforms(); 1718 node->data.has_only_translation_animations = HasOnlyTranslationTransforms();
1728 1719 } else {
1729 } else { 1720 node->data.has_only_translation_animations = true;
1730 node->data.local_maximum_animation_target_scale = 0.f; 1721 }
1731 node->data.local_starting_animation_scale = 0.f; 1722 property_trees->transform_tree.set_needs_update(true);
1732 node->data.has_only_translation_animations = true;
1733 }
1734 property_trees->transform_tree.set_needs_update(true);
1735 } 1723 }
1736 1724
1737 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) { 1725 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) {
1738 DCHECK(layer_tree_host_); 1726 DCHECK(layer_tree_host_);
1739 PropertyTrees* property_trees = layer_tree_host_->property_trees(); 1727 PropertyTrees* property_trees = layer_tree_host_->property_trees();
1740 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) 1728 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id()))
1741 return; 1729 return;
1742 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); 1730 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]);
1743 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); 1731 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index());
1744 node->data.is_currently_animating_opacity = is_currently_animating; 1732 node->data.is_currently_animating_opacity = is_currently_animating;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 ->data.num_copy_requests_in_subtree; 1850 ->data.num_copy_requests_in_subtree;
1863 } 1851 }
1864 1852
1865 gfx::Transform Layer::screen_space_transform() const { 1853 gfx::Transform Layer::screen_space_transform() const {
1866 DCHECK_NE(transform_tree_index_, -1); 1854 DCHECK_NE(transform_tree_index_, -1);
1867 return draw_property_utils::ScreenSpaceTransform( 1855 return draw_property_utils::ScreenSpaceTransform(
1868 this, layer_tree_host_->property_trees()->transform_tree); 1856 this, layer_tree_host_->property_trees()->transform_tree);
1869 } 1857 }
1870 1858
1871 } // namespace cc 1859 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/draw_properties.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698