| 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ui/aura/client/activation_client.h" | 27 #include "ui/aura/client/activation_client.h" |
| 28 #include "ui/aura/client/capture_client.h" | 28 #include "ui/aura/client/capture_client.h" |
| 29 #include "ui/aura/client/focus_client.h" | 29 #include "ui/aura/client/focus_client.h" |
| 30 #include "ui/aura/client/screen_position_client.h" | 30 #include "ui/aura/client/screen_position_client.h" |
| 31 #include "ui/aura/root_window.h" | 31 #include "ui/aura/root_window.h" |
| 32 #include "ui/aura/root_window_transformer.h" | 32 #include "ui/aura/root_window_transformer.h" |
| 33 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 34 #include "ui/aura/window_property.h" | 34 #include "ui/aura/window_property.h" |
| 35 #include "ui/aura/window_tracker.h" | 35 #include "ui/aura/window_tracker.h" |
| 36 #include "ui/compositor/compositor.h" | 36 #include "ui/compositor/compositor.h" |
| 37 #include "ui/compositor/compositor_vsync_manager.h" | |
| 38 #include "ui/gfx/display.h" | 37 #include "ui/gfx/display.h" |
| 39 #include "ui/gfx/screen.h" | 38 #include "ui/gfx/screen.h" |
| 40 | 39 |
| 41 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 42 #include "base/sys_info.h" | 41 #include "base/sys_info.h" |
| 43 #include "base/time/time.h" | 42 #include "base/time/time.h" |
| 44 #if defined(USE_X11) | 43 #if defined(USE_X11) |
| 45 #include "ash/display/output_configurator_animation.h" | 44 #include "ash/display/output_configurator_animation.h" |
| 46 #include "chromeos/display/output_configurator.h" | 45 #include "chromeos/display/output_configurator.h" |
| 47 #include "ui/base/x/x11_util.h" | 46 #include "ui/base/x/x11_util.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); | 113 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); |
| 115 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); | 114 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); |
| 116 ui::SetIntProperty(xwindow, | 115 ui::SetIntProperty(xwindow, |
| 117 kScaleFactorProp, | 116 kScaleFactorProp, |
| 118 kCARDINAL, | 117 kCARDINAL, |
| 119 100 * display.device_scale_factor()); | 118 100 * display.device_scale_factor()); |
| 120 #endif | 119 #endif |
| 121 scoped_ptr<aura::RootWindowTransformer> transformer( | 120 scoped_ptr<aura::RootWindowTransformer> transformer( |
| 122 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); | 121 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); |
| 123 root->host()->SetRootWindowTransformer(transformer.Pass()); | 122 root->host()->SetRootWindowTransformer(transformer.Pass()); |
| 124 | |
| 125 internal::DisplayMode mode; | |
| 126 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && | |
| 127 mode.refresh_rate > 0.0f) { | |
| 128 root->host()->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( | |
| 129 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | |
| 130 mode.refresh_rate)); | |
| 131 } | |
| 132 } | 123 } |
| 133 | 124 |
| 134 } // namespace | 125 } // namespace |
| 135 | 126 |
| 136 namespace internal { | 127 namespace internal { |
| 137 | 128 |
| 138 // A utility class to store/restore focused/active window | 129 // A utility class to store/restore focused/active window |
| 139 // when the display configuration has changed. | 130 // when the display configuration has changed. |
| 140 class FocusActivationStore { | 131 class FocusActivationStore { |
| 141 public: | 132 public: |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 std::string name = | 742 std::string name = |
| 752 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 743 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
| 753 gfx::AcceleratedWidget xwindow = | 744 gfx::AcceleratedWidget xwindow = |
| 754 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); | 745 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); |
| 755 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 746 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
| 756 } | 747 } |
| 757 #endif | 748 #endif |
| 758 } | 749 } |
| 759 | 750 |
| 760 } // namespace ash | 751 } // namespace ash |
| OLD | NEW |