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

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

Issue 2130053002: cc: Clean up Layer and LayerTreeHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@start_minor_layer_cleanup
Patch Set: Rebase 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/layer_tree_impl.cc ('k') | cc/trees/property_tree_builder.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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/trace_event/trace_event_argument.h" 12 #include "base/trace_event/trace_event_argument.h"
13 #include "cc/animation/animation_host.h"
13 #include "cc/layers/layer_impl.h" 14 #include "cc/layers/layer_impl.h"
14 #include "cc/output/copy_output_request.h" 15 #include "cc/output/copy_output_request.h"
15 #include "cc/proto/property_tree.pb.h" 16 #include "cc/proto/property_tree.pb.h"
16 #include "cc/proto/synced_property_conversions.h" 17 #include "cc/proto/synced_property_conversions.h"
17 #include "cc/trees/clip_node.h" 18 #include "cc/trees/clip_node.h"
18 #include "cc/trees/effect_node.h" 19 #include "cc/trees/effect_node.h"
19 #include "cc/trees/layer_tree_host_common.h" 20 #include "cc/trees/layer_tree_host_common.h"
20 #include "cc/trees/layer_tree_impl.h" 21 #include "cc/trees/layer_tree_impl.h"
21 #include "cc/trees/property_tree.h" 22 #include "cc/trees/property_tree.h"
22 #include "cc/trees/scroll_node.h" 23 #include "cc/trees/scroll_node.h"
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 cached_data_.animation_scales[transform_node_id] 1811 cached_data_.animation_scales[transform_node_id]
1811 .combined_maximum_animation_target_scale = 1812 .combined_maximum_animation_target_scale =
1812 max_local_scale * ancestor_maximum_target_scale; 1813 max_local_scale * ancestor_maximum_target_scale;
1813 cached_data_.animation_scales[transform_node_id] 1814 cached_data_.animation_scales[transform_node_id]
1814 .combined_starting_animation_scale = 1815 .combined_starting_animation_scale =
1815 max_local_scale * ancestor_starting_animation_scale; 1816 max_local_scale * ancestor_starting_animation_scale;
1816 } else { 1817 } else {
1817 // TODO(sunxd): make LayerTreeImpl::MaximumTargetScale take layer id as 1818 // TODO(sunxd): make LayerTreeImpl::MaximumTargetScale take layer id as
1818 // parameter. 1819 // parameter.
1819 LayerImpl* layer_impl = layer_tree_impl->LayerById(node->owner_id); 1820 LayerImpl* layer_impl = layer_tree_impl->LayerById(node->owner_id);
1820 layer_tree_impl->MaximumTargetScale( 1821 layer_impl->GetAnimationHost()->MaximumTargetScale(
1821 layer_impl, &cached_data_.animation_scales[transform_node_id] 1822 layer_impl->element_id(), layer_impl->GetElementTypeForAnimation(),
1822 .local_maximum_animation_target_scale); 1823 &cached_data_.animation_scales[transform_node_id]
1823 layer_tree_impl->AnimationStartScale( 1824 .local_maximum_animation_target_scale);
1824 layer_impl, &cached_data_.animation_scales[transform_node_id] 1825 layer_impl->GetAnimationHost()->AnimationStartScale(
1825 .local_starting_animation_scale); 1826 layer_impl->element_id(), layer_impl->GetElementTypeForAnimation(),
1827 &cached_data_.animation_scales[transform_node_id]
1828 .local_starting_animation_scale);
1826 gfx::Vector2dF local_scales = 1829 gfx::Vector2dF local_scales =
1827 MathUtil::ComputeTransform2dScaleComponents(node->local, 0.f); 1830 MathUtil::ComputeTransform2dScaleComponents(node->local, 0.f);
1828 float max_local_scale = std::max(local_scales.x(), local_scales.y()); 1831 float max_local_scale = std::max(local_scales.x(), local_scales.y());
1829 1832
1830 if (cached_data_.animation_scales[transform_node_id] 1833 if (cached_data_.animation_scales[transform_node_id]
1831 .local_starting_animation_scale == 0.f || 1834 .local_starting_animation_scale == 0.f ||
1832 cached_data_.animation_scales[transform_node_id] 1835 cached_data_.animation_scales[transform_node_id]
1833 .local_maximum_animation_target_scale == 0.f) { 1836 .local_maximum_animation_target_scale == 0.f) {
1834 cached_data_.animation_scales[transform_node_id] 1837 cached_data_.animation_scales[transform_node_id]
1835 .combined_maximum_animation_target_scale = 1838 .combined_maximum_animation_target_scale =
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 cached_data_.property_tree_update_number = 0; 1884 cached_data_.property_tree_update_number = 0;
1882 cached_data_.animation_scales = std::vector<AnimationScaleData>( 1885 cached_data_.animation_scales = std::vector<AnimationScaleData>(
1883 transform_tree.nodes().size(), AnimationScaleData()); 1886 transform_tree.nodes().size(), AnimationScaleData());
1884 } 1887 }
1885 1888
1886 void PropertyTrees::UpdateCachedNumber() { 1889 void PropertyTrees::UpdateCachedNumber() {
1887 cached_data_.property_tree_update_number++; 1890 cached_data_.property_tree_update_number++;
1888 } 1891 }
1889 1892
1890 } // namespace cc 1893 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698