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

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

Issue 2796013003: cc: Push Animation Finished State and Use Finished State for IsCompleted (Closed)
Patch Set: clear events before update state in unittest Created 3 years, 8 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_unittest_animation.cc ('k') | no next file » | 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"
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 auto iterator = property_trees()->element_id_to_effect_node_index.find(id); 863 auto iterator = property_trees()->element_id_to_effect_node_index.find(id);
864 if (iterator == property_trees()->element_id_to_effect_node_index.end()) 864 if (iterator == property_trees()->element_id_to_effect_node_index.end())
865 return nullptr; 865 return nullptr;
866 866
867 return Node(iterator->second); 867 return Node(iterator->second);
868 } 868 }
869 869
870 bool EffectTree::OnOpacityAnimated(ElementId id, float opacity) { 870 bool EffectTree::OnOpacityAnimated(ElementId id, float opacity) {
871 EffectNode* node = FindNodeFromElementId(id); 871 EffectNode* node = FindNodeFromElementId(id);
872 DCHECK(node); 872 DCHECK(node);
873 // TODO(crbug.com/706766): Avoid crash. Need more investigation for what is
874 // calling this without setting element id.
875 if (!node)
876 return false;
877
878 if (node->opacity == opacity) 873 if (node->opacity == opacity)
879 return false; 874 return false;
880 node->opacity = opacity; 875 node->opacity = opacity;
881 node->effect_changed = true; 876 node->effect_changed = true;
882 property_trees()->changed = true; 877 property_trees()->changed = true;
883 property_trees()->effect_tree.set_needs_update(true); 878 property_trees()->effect_tree.set_needs_update(true);
884 return true; 879 return true;
885 } 880 }
886 881
887 bool EffectTree::OnFilterAnimated(ElementId id, 882 bool EffectTree::OnFilterAnimated(ElementId id,
888 const FilterOperations& filters) { 883 const FilterOperations& filters) {
889 EffectNode* node = FindNodeFromElementId(id); 884 EffectNode* node = FindNodeFromElementId(id);
890 DCHECK(node); 885 DCHECK(node);
891 // TODO(crbug.com/706766): Avoid crash. Need more investigation for what is
892 // calling this without setting element id.
893 if (!node)
894 return false;
895
896 if (node->filters == filters) 886 if (node->filters == filters)
897 return false; 887 return false;
898 node->filters = filters; 888 node->filters = filters;
899 node->effect_changed = true; 889 node->effect_changed = true;
900 property_trees()->changed = true; 890 property_trees()->changed = true;
901 property_trees()->effect_tree.set_needs_update(true); 891 property_trees()->effect_tree.set_needs_update(true);
902 return true; 892 return true;
903 } 893 }
904 894
905 void EffectTree::UpdateEffects(int id) { 895 void EffectTree::UpdateEffects(int id) {
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 const EffectNode* effect_node = effect_tree.Node(effect_id); 2136 const EffectNode* effect_node = effect_tree.Node(effect_id);
2147 2137
2148 if (effect_node->surface_contents_scale.x() != 0.0 && 2138 if (effect_node->surface_contents_scale.x() != 0.0 &&
2149 effect_node->surface_contents_scale.y() != 0.0) 2139 effect_node->surface_contents_scale.y() != 0.0)
2150 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), 2140 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(),
2151 1.0 / effect_node->surface_contents_scale.y()); 2141 1.0 / effect_node->surface_contents_scale.y());
2152 return screen_space_transform; 2142 return screen_space_transform;
2153 } 2143 }
2154 2144
2155 } // namespace cc 2145 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698