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/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
10 #include "ash/host/root_window_transformer.h" | 10 #include "ash/host/root_window_transformer.h" |
11 #include "ash/magnifier/magnification_controller.h" | 11 #include "ash/magnifier/magnification_controller.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "third_party/skia/include/core/SkMatrix44.h" | 14 #include "third_party/skia/include/core/SkMatrix44.h" |
15 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
16 #include "ui/aura/window_property.h" | 16 #include "ui/base/class_property.h" |
17 #include "ui/compositor/dip_util.h" | 17 #include "ui/compositor/dip_util.h" |
18 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
19 #include "ui/display/manager/display_manager.h" | 19 #include "ui/display/manager/display_manager.h" |
20 #include "ui/display/manager/managed_display_info.h" | 20 #include "ui/display/manager/managed_display_info.h" |
21 #include "ui/display/screen.h" | 21 #include "ui/display/screen.h" |
22 #include "ui/gfx/geometry/insets.h" | 22 #include "ui/gfx/geometry/insets.h" |
23 #include "ui/gfx/geometry/size_conversions.h" | 23 #include "ui/gfx/geometry/size_conversions.h" |
24 #include "ui/gfx/transform.h" | 24 #include "ui/gfx/transform.h" |
25 #include "ui/gfx/transform.h" | 25 #include "ui/gfx/transform.h" |
26 | 26 |
27 DECLARE_WINDOW_PROPERTY_TYPE(display::Display::Rotation); | 27 DECLARE_UI_CLASS_PROPERTY_TYPE(display::Display::Rotation); |
28 | 28 |
29 namespace ash { | 29 namespace ash { |
30 namespace { | 30 namespace { |
31 | 31 |
32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
33 DEFINE_WINDOW_PROPERTY_KEY(display::Display::Rotation, | 33 DEFINE_UI_CLASS_PROPERTY_KEY(display::Display::Rotation, |
34 kRotationPropertyKey, | 34 kRotationPropertyKey, |
35 display::Display::ROTATE_0); | 35 display::Display::ROTATE_0); |
36 #endif | 36 #endif |
37 | 37 |
38 // Round near zero value to zero. | 38 // Round near zero value to zero. |
39 void RoundNearZero(gfx::Transform* transform) { | 39 void RoundNearZero(gfx::Transform* transform) { |
40 const float kEpsilon = 0.001f; | 40 const float kEpsilon = 0.001f; |
41 SkMatrix44& matrix = transform->matrix(); | 41 SkMatrix44& matrix = transform->matrix(); |
42 for (int x = 0; x < 4; ++x) { | 42 for (int x = 0; x < 4; ++x) { |
43 for (int y = 0; y < 4; ++y) { | 43 for (int y = 0; y < 4; ++y) { |
44 if (std::abs(SkMScalarToFloat(matrix.get(x, y))) < kEpsilon) | 44 if (std::abs(SkMScalarToFloat(matrix.get(x, y))) < kEpsilon) |
45 matrix.set(x, y, SkFloatToMScalar(0.0f)); | 45 matrix.set(x, y, SkFloatToMScalar(0.0f)); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 mirror_display_info); | 326 mirror_display_info); |
327 } | 327 } |
328 | 328 |
329 RootWindowTransformer* CreateRootWindowTransformerForUnifiedDesktop( | 329 RootWindowTransformer* CreateRootWindowTransformerForUnifiedDesktop( |
330 const gfx::Rect& screen_bounds, | 330 const gfx::Rect& screen_bounds, |
331 const display::Display& display) { | 331 const display::Display& display) { |
332 return new PartialBoundsRootWindowTransformer(screen_bounds, display); | 332 return new PartialBoundsRootWindowTransformer(screen_bounds, display); |
333 } | 333 } |
334 | 334 |
335 } // namespace ash | 335 } // namespace ash |
OLD | NEW |