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

Side by Side Diff: cc/trees/layer_tree_host.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.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('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.h" 5 #include "cc/trees/layer_tree_host.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 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 1354
1355 void LayerTreeHost::ElementTransformIsPotentiallyAnimatingChanged( 1355 void LayerTreeHost::ElementTransformIsPotentiallyAnimatingChanged(
1356 ElementId element_id, 1356 ElementId element_id,
1357 ElementListType list_type, 1357 ElementListType list_type,
1358 bool is_animating) { 1358 bool is_animating) {
1359 Layer* layer = LayerById(element_id); 1359 Layer* layer = LayerById(element_id);
1360 DCHECK(layer); 1360 DCHECK(layer);
1361 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); 1361 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
1362 } 1362 }
1363 1363
1364 void LayerTreeHost::ElementOpacityIsAnimatingChanged(
1365 ElementId element_id,
1366 ElementListType list_type,
1367 AnimationChangeType change_type,
1368 bool is_animating) {
1369 Layer* layer = LayerById(element_id);
1370 if (layer) {
1371 switch (change_type) {
1372 case AnimationChangeType::POTENTIAL:
1373 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
1374 break;
1375 case AnimationChangeType::RUNNING:
1376 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
1377 break;
1378 case AnimationChangeType::BOTH:
1379 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
1380 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
1381 break;
1382 }
1383 }
1384 }
1385
1364 gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation( 1386 gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation(
1365 ElementId element_id) const { 1387 ElementId element_id) const {
1366 Layer* layer = LayerById(element_id); 1388 Layer* layer = LayerById(element_id);
1367 DCHECK(layer); 1389 DCHECK(layer);
1368 return layer->ScrollOffsetForAnimation(); 1390 return layer->ScrollOffsetForAnimation();
1369 } 1391 }
1370 1392
1371 bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted( 1393 bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted(
1372 const Layer* layer) const { 1394 const Layer* layer) const {
1373 return animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id()); 1395 return animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id());
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 int seq_num = property_trees_.sequence_number; 1659 int seq_num = property_trees_.sequence_number;
1638 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1660 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1639 layer->set_property_tree_sequence_number(seq_num); 1661 layer->set_property_tree_sequence_number(seq_num);
1640 }); 1662 });
1641 1663
1642 surface_id_namespace_ = proto.surface_id_namespace(); 1664 surface_id_namespace_ = proto.surface_id_namespace();
1643 next_surface_sequence_ = proto.next_surface_sequence(); 1665 next_surface_sequence_ = proto.next_surface_sequence();
1644 } 1666 }
1645 1667
1646 } // namespace cc 1668 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698