OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/display/root_window_transformers.h" | 5 #include "ash/display/root_window_transformers.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 const float kEpsilon = 0.001f; | 37 const float kEpsilon = 0.001f; |
38 SkMatrix44& matrix = transform->matrix(); | 38 SkMatrix44& matrix = transform->matrix(); |
39 for (int x = 0; x < 4; ++x) { | 39 for (int x = 0; x < 4; ++x) { |
40 for (int y = 0; y < 4; ++y) { | 40 for (int y = 0; y < 4; ++y) { |
41 if (std::abs(SkMScalarToFloat(matrix.get(x, y))) < kEpsilon) | 41 if (std::abs(SkMScalarToFloat(matrix.get(x, y))) < kEpsilon) |
42 matrix.set(x, y, SkFloatToMScalar(0.0f)); | 42 matrix.set(x, y, SkFloatToMScalar(0.0f)); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
| 47 // TODO(oshima): Transformers should be able to adjust itself |
| 48 // when the device scale factor is changed, instead of |
| 49 // precalculating the transform using fixed value. |
| 50 |
47 gfx::Transform CreateRotationTransform(aura::RootWindow* root_window, | 51 gfx::Transform CreateRotationTransform(aura::RootWindow* root_window, |
48 const gfx::Display& display) { | 52 const gfx::Display& display) { |
49 DisplayInfo info = | 53 DisplayInfo info = |
50 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); | 54 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); |
51 | 55 |
52 // TODO(oshima): Add animation. (crossfade+rotation, or just cross-fade) | 56 // TODO(oshima): Add animation. (crossfade+rotation, or just cross-fade) |
53 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
54 // Windows 8 bots refused to resize the host window, and | 58 // Windows 8 bots refused to resize the host window, and |
55 // updating the transform results in incorrectly resizing | 59 // updating the transform results in incorrectly resizing |
56 // the root window. Don't apply the transform unless | 60 // the root window. Don't apply the transform unless |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 284 |
281 aura::RootWindowTransformer* CreateRootWindowTransformerForMirroredDisplay( | 285 aura::RootWindowTransformer* CreateRootWindowTransformerForMirroredDisplay( |
282 const DisplayInfo& source_display_info, | 286 const DisplayInfo& source_display_info, |
283 const DisplayInfo& mirror_display_info) { | 287 const DisplayInfo& mirror_display_info) { |
284 return new MirrorRootWindowTransformer(source_display_info, | 288 return new MirrorRootWindowTransformer(source_display_info, |
285 mirror_display_info); | 289 mirror_display_info); |
286 } | 290 } |
287 | 291 |
288 } // namespace internal | 292 } // namespace internal |
289 } // namespace ash | 293 } // namespace ash |
OLD | NEW |