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

Side by Side Diff: cc/animation/element_animations.cc

Issue 2655993002: cc: Fix animation bounds computation for multiple players (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | cc/animation/element_animations_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation/element_animations.h" 5 #include "cc/animation/element_animations.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // TODO(avallee): Implement. 234 // TODO(avallee): Implement.
235 return false; 235 return false;
236 } 236 }
237 237
238 bool ElementAnimations::TransformAnimationBoundsForBox( 238 bool ElementAnimations::TransformAnimationBoundsForBox(
239 const gfx::BoxF& box, 239 const gfx::BoxF& box,
240 gfx::BoxF* bounds) const { 240 gfx::BoxF* bounds) const {
241 *bounds = gfx::BoxF(); 241 *bounds = gfx::BoxF();
242 242
243 for (auto& player : players_list_) { 243 for (auto& player : players_list_) {
244 if (!player.HasTransformAnimationThatInflatesBounds())
245 continue;
244 gfx::BoxF player_bounds; 246 gfx::BoxF player_bounds;
245 bool success = player.TransformAnimationBoundsForBox(box, &player_bounds); 247 bool success = player.TransformAnimationBoundsForBox(box, &player_bounds);
246 if (!success) 248 if (!success)
247 return false; 249 return false;
248 bounds->Union(player_bounds); 250 bounds->Union(player_bounds);
249 } 251 }
250 return true; 252 return true;
251 } 253 }
252 254
253 bool ElementAnimations::HasOnlyTranslationTransforms( 255 bool ElementAnimations::HasOnlyTranslationTransforms(
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (animation_host()) { 488 if (animation_host()) {
487 DCHECK(animation_host()->mutator_host_client()); 489 DCHECK(animation_host()->mutator_host_client());
488 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( 490 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation(
489 element_id()); 491 element_id());
490 } 492 }
491 493
492 return gfx::ScrollOffset(); 494 return gfx::ScrollOffset();
493 } 495 }
494 496
495 } // namespace cc 497 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698