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

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

Issue 1987123002: cc : Track transform animation changes on transform tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/mutator_host_client.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.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 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after
3859 LayerTreeImpl* tree, 3859 LayerTreeImpl* tree,
3860 const gfx::ScrollOffset& scroll_offset) { 3860 const gfx::ScrollOffset& scroll_offset) {
3861 if (!tree) 3861 if (!tree)
3862 return; 3862 return;
3863 3863
3864 LayerImpl* layer = tree->LayerById(layer_id); 3864 LayerImpl* layer = tree->LayerById(layer_id);
3865 if (layer) 3865 if (layer)
3866 layer->OnScrollOffsetAnimated(scroll_offset); 3866 layer->OnScrollOffsetAnimated(scroll_offset);
3867 } 3867 }
3868 3868
3869 void LayerTreeHostImpl::TreeLayerTransformIsPotentiallyAnimatingChanged(
3870 int layer_id,
3871 LayerTreeImpl* tree,
3872 bool is_animating) {
3873 if (!tree)
3874 return;
3875
3876 LayerImpl* layer = tree->LayerById(layer_id);
3877 if (layer)
3878 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
3879 }
3880
3881 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( 3869 bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment(
3882 const LayerImpl* layer) const { 3870 const LayerImpl* layer) const {
3883 return animation_host_->AnimationsPreserveAxisAlignment(layer->id()); 3871 return animation_host_->AnimationsPreserveAxisAlignment(layer->id());
3884 } 3872 }
3885 3873
3886 void LayerTreeHostImpl::SetElementFilterMutated( 3874 void LayerTreeHostImpl::SetElementFilterMutated(
3887 ElementId element_id, 3875 ElementId element_id,
3888 ElementListType list_type, 3876 ElementListType list_type,
3889 const FilterOperations& filters) { 3877 const FilterOperations& filters) {
3890 if (list_type == ElementListType::ACTIVE) { 3878 if (list_type == ElementListType::ACTIVE) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3923 ElementListType list_type, 3911 ElementListType list_type,
3924 const gfx::ScrollOffset& scroll_offset) { 3912 const gfx::ScrollOffset& scroll_offset) {
3925 if (list_type == ElementListType::ACTIVE) { 3913 if (list_type == ElementListType::ACTIVE) {
3926 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset); 3914 SetTreeLayerScrollOffsetMutated(element_id, active_tree(), scroll_offset);
3927 } else { 3915 } else {
3928 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset); 3916 SetTreeLayerScrollOffsetMutated(element_id, pending_tree(), scroll_offset);
3929 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset); 3917 SetTreeLayerScrollOffsetMutated(element_id, recycle_tree(), scroll_offset);
3930 } 3918 }
3931 } 3919 }
3932 3920
3933 void LayerTreeHostImpl::ElementTransformIsPotentiallyAnimatingChanged( 3921 void LayerTreeHostImpl::ElementTransformIsAnimatingChanged(
3934 ElementId element_id, 3922 ElementId element_id,
3935 ElementListType list_type, 3923 ElementListType list_type,
3924 AnimationChangeType change_type,
3936 bool is_animating) { 3925 bool is_animating) {
3937 if (list_type == ElementListType::ACTIVE) { 3926 LayerTreeImpl* tree =
3938 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, active_tree(), 3927 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
3939 is_animating); 3928 if (!tree)
3940 } else { 3929 return;
3941 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, pending_tree(), 3930 LayerImpl* layer = tree->LayerById(element_id);
3942 is_animating); 3931 if (layer) {
3932 switch (change_type) {
3933 case AnimationChangeType::POTENTIAL:
3934 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
3935 break;
3936 case AnimationChangeType::RUNNING:
3937 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating);
3938 break;
3939 case AnimationChangeType::BOTH:
3940 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
3941 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating);
3942 break;
3943 }
3943 } 3944 }
3944 } 3945 }
3946
3945 void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged( 3947 void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged(
3946 ElementId element_id, 3948 ElementId element_id,
3947 ElementListType list_type, 3949 ElementListType list_type,
3948 AnimationChangeType change_type, 3950 AnimationChangeType change_type,
3949 bool is_animating) { 3951 bool is_animating) {
3950 LayerTreeImpl* tree = 3952 LayerTreeImpl* tree =
3951 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree(); 3953 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
3952 if (!tree) 3954 if (!tree)
3953 return; 3955 return;
3954 LayerImpl* layer = tree->LayerById(element_id); 3956 LayerImpl* layer = tree->LayerById(element_id);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 const { 4003 const {
4002 return fixed_raster_scale_attempted_scale_change_history_.count() >= 4004 return fixed_raster_scale_attempted_scale_change_history_.count() >=
4003 kFixedRasterScaleAttemptedScaleChangeThreshold; 4005 kFixedRasterScaleAttemptedScaleChangeThreshold;
4004 } 4006 }
4005 4007
4006 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { 4008 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() {
4007 fixed_raster_scale_attempted_scale_change_history_.set(0); 4009 fixed_raster_scale_attempted_scale_change_history_.set(0);
4008 } 4010 }
4009 4011
4010 } // namespace cc 4012 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/mutator_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698