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

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

Issue 1957533002: cc : Track opacity animation changes on effect 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 3920 matching lines...) Expand 10 before | Expand all | Expand 10 after
3931 ElementListType list_type, 3931 ElementListType list_type,
3932 bool is_animating) { 3932 bool is_animating) {
3933 if (list_type == ElementListType::ACTIVE) { 3933 if (list_type == ElementListType::ACTIVE) {
3934 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, active_tree(), 3934 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, active_tree(),
3935 is_animating); 3935 is_animating);
3936 } else { 3936 } else {
3937 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, pending_tree(), 3937 TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, pending_tree(),
3938 is_animating); 3938 is_animating);
3939 } 3939 }
3940 } 3940 }
3941 void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged(
3942 ElementId element_id,
3943 ElementListType list_type,
3944 AnimationChangeType change_type,
3945 bool is_animating) {
3946 LayerTreeImpl* tree =
3947 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
3948 if (!tree)
3949 return;
3950 LayerImpl* layer = tree->LayerById(element_id);
3951 if (layer) {
3952 switch (change_type) {
3953 case AnimationChangeType::POTENTIAL:
3954 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
3955 break;
3956 case AnimationChangeType::RUNNING:
3957 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
3958 break;
3959 case AnimationChangeType::BOTH:
3960 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
3961 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
3962 break;
3963 }
3964 }
3965 }
3941 3966
3942 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { 3967 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() {
3943 // TODO(majidvp): We should pass in the original starting scroll position here 3968 // TODO(majidvp): We should pass in the original starting scroll position here
3944 ScrollStateData scroll_state_data; 3969 ScrollStateData scroll_state_data;
3945 ScrollState scroll_state(scroll_state_data); 3970 ScrollState scroll_state(scroll_state_data);
3946 ScrollEnd(&scroll_state); 3971 ScrollEnd(&scroll_state);
3947 } 3972 }
3948 3973
3949 gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation( 3974 gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation(
3950 ElementId element_id) const { 3975 ElementId element_id) const {
(...skipping 11 matching lines...) Expand all
3962 return task_runner_provider_->HasImplThread(); 3987 return task_runner_provider_->HasImplThread();
3963 } 3988 }
3964 3989
3965 bool LayerTreeHostImpl::CommitToActiveTree() const { 3990 bool LayerTreeHostImpl::CommitToActiveTree() const {
3966 // In single threaded mode we skip the pending tree and commit directly to the 3991 // In single threaded mode we skip the pending tree and commit directly to the
3967 // active tree. 3992 // active tree.
3968 return !task_runner_provider_->HasImplThread(); 3993 return !task_runner_provider_->HasImplThread();
3969 } 3994 }
3970 3995
3971 } // namespace cc 3996 } // 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