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 "ash/wm/window_animations.h" | 5 #include "ash/wm/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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const float kWindowAnimation_HideBrightnessGrayscale = 1.f; | 55 const float kWindowAnimation_HideBrightnessGrayscale = 1.f; |
56 const float kWindowAnimation_ShowBrightnessGrayscale = 0.f; | 56 const float kWindowAnimation_ShowBrightnessGrayscale = 0.f; |
57 | 57 |
58 const float kWindowAnimation_HideOpacity = 0.f; | 58 const float kWindowAnimation_HideOpacity = 0.f; |
59 const float kWindowAnimation_ShowOpacity = 1.f; | 59 const float kWindowAnimation_ShowOpacity = 1.f; |
60 | 60 |
61 // Scales for AshWindow above/below current workspace. | 61 // Scales for AshWindow above/below current workspace. |
62 const float kLayerScaleAboveSize = 1.1f; | 62 const float kLayerScaleAboveSize = 1.1f; |
63 const float kLayerScaleBelowSize = .9f; | 63 const float kLayerScaleBelowSize = .9f; |
64 | 64 |
65 int64 Round64(float f) { | 65 int64_t Round64(float f) { |
66 return static_cast<int64>(f + 0.5f); | 66 return static_cast<int64_t>(f + 0.5f); |
67 } | 67 } |
68 | 68 |
69 base::TimeDelta GetCrossFadeDuration(aura::Window* window, | 69 base::TimeDelta GetCrossFadeDuration(aura::Window* window, |
70 const gfx::RectF& old_bounds, | 70 const gfx::RectF& old_bounds, |
71 const gfx::Rect& new_bounds) { | 71 const gfx::Rect& new_bounds) { |
72 if (::wm::WindowAnimationsDisabled(window)) | 72 if (::wm::WindowAnimationsDisabled(window)) |
73 return base::TimeDelta(); | 73 return base::TimeDelta(); |
74 | 74 |
75 int old_area = static_cast<int>(old_bounds.width() * old_bounds.height()); | 75 int old_area = static_cast<int>(old_bounds.width() * old_bounds.height()); |
76 int new_area = new_bounds.width() * new_bounds.height(); | 76 int new_area = new_bounds.width() * new_bounds.height(); |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 case SHELF_ALIGNMENT_LEFT: | 503 case SHELF_ALIGNMENT_LEFT: |
504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); | 504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
505 case SHELF_ALIGNMENT_RIGHT: | 505 case SHELF_ALIGNMENT_RIGHT: |
506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); | 506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
507 } | 507 } |
508 NOTREACHED(); | 508 NOTREACHED(); |
509 return gfx::Rect(); | 509 return gfx::Rect(); |
510 } | 510 } |
511 | 511 |
512 } // namespace ash | 512 } // namespace ash |
OLD | NEW |