OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/wm/core/window_animations.h" | 5 #include "ui/wm/core/window_animations.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 while (root->parent()) | 221 while (root->parent()) |
222 root = root->parent(); | 222 root = root->parent(); |
223 layer->GetTargetTransformRelativeTo(root, transform); | 223 layer->GetTargetTransformRelativeTo(root, transform); |
224 } | 224 } |
225 | 225 |
226 gfx::Rect GetLayerWorldBoundsAfterTransform(ui::Layer* layer, | 226 gfx::Rect GetLayerWorldBoundsAfterTransform(ui::Layer* layer, |
227 const gfx::Transform& transform) { | 227 const gfx::Transform& transform) { |
228 gfx::Transform in_world = transform; | 228 gfx::Transform in_world = transform; |
229 GetTransformRelativeToRoot(layer, &in_world); | 229 GetTransformRelativeToRoot(layer, &in_world); |
230 | 230 |
231 gfx::RectF transformed = layer->bounds(); | 231 gfx::RectF transformed = gfx::RectF(layer->bounds()); |
232 in_world.TransformRect(&transformed); | 232 in_world.TransformRect(&transformed); |
233 | 233 |
234 return gfx::ToEnclosingRect(transformed); | 234 return gfx::ToEnclosingRect(transformed); |
235 } | 235 } |
236 | 236 |
237 // Augment the host window so that the enclosing bounds of the full | 237 // Augment the host window so that the enclosing bounds of the full |
238 // animation will fit inside of it. | 238 // animation will fit inside of it. |
239 void AugmentWindowSize(aura::Window* window, | 239 void AugmentWindowSize(aura::Window* window, |
240 const gfx::Transform& end_transform) { | 240 const gfx::Transform& end_transform) { |
241 aura::client::AnimationHost* animation_host = | 241 aura::client::AnimationHost* animation_host = |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 // being accessed via Remote Desktop. | 659 // being accessed via Remote Desktop. |
660 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == | 660 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == |
661 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) | 661 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) |
662 return false; | 662 return false; |
663 | 663 |
664 // Let the user decide whether or not to play the animation. | 664 // Let the user decide whether or not to play the animation. |
665 return !gfx::Animation::ShouldRenderRichAnimation(); | 665 return !gfx::Animation::ShouldRenderRichAnimation(); |
666 } | 666 } |
667 | 667 |
668 } // namespace wm | 668 } // namespace wm |
OLD | NEW |