| 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/display/display_manager.h" | |
| 11 #include "ash/host/root_window_transformer.h" | 10 #include "ash/host/root_window_transformer.h" |
| 12 #include "ash/magnifier/magnification_controller.h" | 11 #include "ash/magnifier/magnification_controller.h" |
| 13 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 15 #include "third_party/skia/include/core/SkMatrix44.h" | 14 #include "third_party/skia/include/core/SkMatrix44.h" |
| 16 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
| 17 #include "ui/aura/window_property.h" | 16 #include "ui/aura/window_property.h" |
| 18 #include "ui/compositor/dip_util.h" | 17 #include "ui/compositor/dip_util.h" |
| 19 #include "ui/display/display.h" | 18 #include "ui/display/display.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_WINDOW_PROPERTY_TYPE(display::Display::Rotation); |
| 28 | 28 |
| 29 namespace ash { | 29 namespace ash { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 transform.matrix().set3x3(-1, 0, 0, 0, 1, 0, 0, 0, 1); | 131 transform.matrix().set3x3(-1, 0, 0, 0, 1, 0, 0, 0, 1); |
| 132 transform.Translate(-display.size().width(), 0); | 132 transform.Translate(-display.size().width(), 0); |
| 133 return transform; | 133 return transform; |
| 134 } | 134 } |
| 135 | 135 |
| 136 // RootWindowTransformer for ash environment. | 136 // RootWindowTransformer for ash environment. |
| 137 class AshRootWindowTransformer : public RootWindowTransformer { | 137 class AshRootWindowTransformer : public RootWindowTransformer { |
| 138 public: | 138 public: |
| 139 AshRootWindowTransformer(aura::Window* root, const display::Display& display) | 139 AshRootWindowTransformer(aura::Window* root, const display::Display& display) |
| 140 : root_window_(root) { | 140 : root_window_(root) { |
| 141 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 141 display::DisplayManager* display_manager = |
| 142 Shell::GetInstance()->display_manager(); |
| 142 display::ManagedDisplayInfo info = | 143 display::ManagedDisplayInfo info = |
| 143 display_manager->GetDisplayInfo(display.id()); | 144 display_manager->GetDisplayInfo(display.id()); |
| 144 host_insets_ = info.GetOverscanInsetsInPixel(); | 145 host_insets_ = info.GetOverscanInsetsInPixel(); |
| 145 root_window_ui_scale_ = info.GetEffectiveUIScale(); | 146 root_window_ui_scale_ = info.GetEffectiveUIScale(); |
| 146 root_window_bounds_transform_ = | 147 root_window_bounds_transform_ = |
| 147 CreateInsetsAndScaleTransform(host_insets_, | 148 CreateInsetsAndScaleTransform(host_insets_, |
| 148 display.device_scale_factor(), | 149 display.device_scale_factor(), |
| 149 root_window_ui_scale_) * | 150 root_window_ui_scale_) * |
| 150 CreateRotationTransform(root, display); | 151 CreateRotationTransform(root, display); |
| 151 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 152 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 mirror_display_info); | 326 mirror_display_info); |
| 326 } | 327 } |
| 327 | 328 |
| 328 RootWindowTransformer* CreateRootWindowTransformerForUnifiedDesktop( | 329 RootWindowTransformer* CreateRootWindowTransformerForUnifiedDesktop( |
| 329 const gfx::Rect& screen_bounds, | 330 const gfx::Rect& screen_bounds, |
| 330 const display::Display& display) { | 331 const display::Display& display) { |
| 331 return new PartialBoundsRootWindowTransformer(screen_bounds, display); | 332 return new PartialBoundsRootWindowTransformer(screen_bounds, display); |
| 332 } | 333 } |
| 333 | 334 |
| 334 } // namespace ash | 335 } // namespace ash |
| OLD | NEW |