| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |