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

Side by Side Diff: cc/layers/layer_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/layers/layer_impl.h ('k') | cc/proto/property_tree.proto » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_impl.h" 5 #include "cc/layers/layer_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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); 777 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset));
778 778
779 layer_tree_impl_->DidAnimateScrollOffset(); 779 layer_tree_impl_->DidAnimateScrollOffset();
780 } 780 }
781 781
782 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged(bool is_animating) { 782 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged(bool is_animating) {
783 UpdatePropertyTreeTransformIsAnimated(is_animating); 783 UpdatePropertyTreeTransformIsAnimated(is_animating);
784 was_ever_ready_since_last_transform_animation_ = false; 784 was_ever_ready_since_last_transform_animation_ = false;
785 } 785 }
786 786
787 void LayerImpl::OnOpacityIsCurrentlyAnimatingChanged(
788 bool is_currently_animating) {
789 DCHECK(layer_tree_impl_);
790 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree;
791 EffectNode* node = effect_tree.Node(effect_tree_index());
792
793 if (node->owner_id == id())
794 node->data.is_currently_animating_opacity = is_currently_animating;
795 }
796
797 void LayerImpl::OnOpacityIsPotentiallyAnimatingChanged(
798 bool has_potential_animation) {
799 DCHECK(layer_tree_impl_);
800 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree;
801 EffectNode* node = effect_tree.Node(effect_tree_index());
802 if (!node)
803 return;
804 if (node->owner_id == id()) {
805 node->data.has_potential_opacity_animation = has_potential_animation;
806 effect_tree.set_needs_update(true);
807 }
808 }
809
787 bool LayerImpl::IsActive() const { 810 bool LayerImpl::IsActive() const {
788 return layer_tree_impl_->IsActiveTree(); 811 return layer_tree_impl_->IsActiveTree();
789 } 812 }
790 813
791 gfx::Size LayerImpl::bounds() const { 814 gfx::Size LayerImpl::bounds() const {
792 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_); 815 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_);
793 return gfx::Size(bounds_.width() + delta.x(), 816 return gfx::Size(bounds_.width() + delta.x(),
794 bounds_.height() + delta.y()); 817 bounds_.height() + delta.y());
795 } 818 }
796 819
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 .layer_transforms_should_scale_layer_contents) { 1415 .layer_transforms_should_scale_layer_contents) {
1393 return default_scale; 1416 return default_scale;
1394 } 1417 }
1395 1418
1396 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1419 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1397 DrawTransform(), default_scale); 1420 DrawTransform(), default_scale);
1398 return std::max(transform_scales.x(), transform_scales.y()); 1421 return std::max(transform_scales.x(), transform_scales.y());
1399 } 1422 }
1400 1423
1401 } // namespace cc 1424 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698