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

Side by Side Diff: cc/layers/layer.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
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 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 1660
1661 } else { 1661 } else {
1662 node->data.local_maximum_animation_target_scale = 0.f; 1662 node->data.local_maximum_animation_target_scale = 0.f;
1663 node->data.local_starting_animation_scale = 0.f; 1663 node->data.local_starting_animation_scale = 0.f;
1664 node->data.has_only_translation_animations = true; 1664 node->data.has_only_translation_animations = true;
1665 } 1665 }
1666 transform_tree.set_needs_update(true); 1666 transform_tree.set_needs_update(true);
1667 } 1667 }
1668 } 1668 }
1669 1669
1670 void Layer::OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating) {
1671 DCHECK(layer_tree_host_);
1672 EffectTree& effect_tree = layer_tree_host_->property_trees()->effect_tree;
1673 EffectNode* node = effect_tree.Node(effect_tree_index());
1674 if (!node)
ajuma 2016/05/09 16:56:55 When does this happen? (That is, when does a layer
jaydasika 2016/05/10 20:22:29 In a lot of tests, almost all LayerTreeHostAnimati
ajuma 2016/05/10 20:46:20 Ah, this is on Layer, so it might be that we're ju
1675 return;
1676
1677 if (node->owner_id == id())
1678 node->data.is_currently_animating_opacity = is_currently_animating;
1679 }
1680
1681 void Layer::OnOpacityIsPotentiallyAnimatingChanged(
1682 bool has_potential_animation) {
1683 DCHECK(layer_tree_host_);
1684 EffectTree& effect_tree = layer_tree_host_->property_trees()->effect_tree;
1685 EffectNode* node = effect_tree.Node(effect_tree_index());
1686 if (!node)
1687 return;
1688 if (node->owner_id == id()) {
1689 node->data.has_potential_opacity_animation = has_potential_animation;
ajuma 2016/05/09 16:56:55 This also needs to take Layer::OpacityCanAnimateOn
jaydasika 2016/05/10 20:22:29 Done.
1690 effect_tree.set_needs_update(true);
1691 }
1692 }
1693
1670 bool Layer::HasActiveAnimationForTesting() const { 1694 bool Layer::HasActiveAnimationForTesting() const {
1671 return layer_tree_host_ ? layer_tree_host_->HasActiveAnimationForTesting(this) 1695 return layer_tree_host_ ? layer_tree_host_->HasActiveAnimationForTesting(this)
1672 : false; 1696 : false;
1673 } 1697 }
1674 1698
1675 ScrollbarLayerInterface* Layer::ToScrollbarLayer() { 1699 ScrollbarLayerInterface* Layer::ToScrollbarLayer() {
1676 return nullptr; 1700 return nullptr;
1677 } 1701 }
1678 1702
1679 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { 1703 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 ->data.num_copy_requests_in_subtree; 1776 ->data.num_copy_requests_in_subtree;
1753 } 1777 }
1754 1778
1755 gfx::Transform Layer::screen_space_transform() const { 1779 gfx::Transform Layer::screen_space_transform() const {
1756 DCHECK_NE(transform_tree_index_, -1); 1780 DCHECK_NE(transform_tree_index_, -1);
1757 return draw_property_utils::ScreenSpaceTransform( 1781 return draw_property_utils::ScreenSpaceTransform(
1758 this, layer_tree_host_->property_trees()->transform_tree); 1782 this, layer_tree_host_->property_trees()->transform_tree);
1759 } 1783 }
1760 1784
1761 } // namespace cc 1785 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698