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 15 matching lines...) Expand all Loading... | |
26 #include "ui/aura/client/activation_client.h" | 26 #include "ui/aura/client/activation_client.h" |
27 #include "ui/aura/client/capture_client.h" | 27 #include "ui/aura/client/capture_client.h" |
28 #include "ui/aura/client/focus_client.h" | 28 #include "ui/aura/client/focus_client.h" |
29 #include "ui/aura/client/screen_position_client.h" | 29 #include "ui/aura/client/screen_position_client.h" |
30 #include "ui/aura/root_window.h" | 30 #include "ui/aura/root_window.h" |
31 #include "ui/aura/root_window_transformer.h" | 31 #include "ui/aura/root_window_transformer.h" |
32 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
33 #include "ui/aura/window_property.h" | 33 #include "ui/aura/window_property.h" |
34 #include "ui/aura/window_tracker.h" | 34 #include "ui/aura/window_tracker.h" |
35 #include "ui/compositor/compositor.h" | 35 #include "ui/compositor/compositor.h" |
36 #include "ui/compositor/compositor_vsync_manager.h" | |
36 #include "ui/gfx/display.h" | 37 #include "ui/gfx/display.h" |
37 #include "ui/gfx/screen.h" | 38 #include "ui/gfx/screen.h" |
38 | 39 |
39 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
40 #include "base/sys_info.h" | 41 #include "base/sys_info.h" |
41 #include "base/time/time.h" | 42 #include "base/time/time.h" |
42 #if defined(USE_X11) | 43 #if defined(USE_X11) |
43 #include "ash/display/output_configurator_animation.h" | 44 #include "ash/display/output_configurator_animation.h" |
44 #include "chromeos/display/output_configurator.h" | 45 #include "chromeos/display/output_configurator.h" |
45 #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... | |
112 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); | 113 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); |
113 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); | 114 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); |
114 ui::SetIntProperty(xwindow, | 115 ui::SetIntProperty(xwindow, |
115 kScaleFactorProp, | 116 kScaleFactorProp, |
116 kCARDINAL, | 117 kCARDINAL, |
117 100 * display.device_scale_factor()); | 118 100 * display.device_scale_factor()); |
118 #endif | 119 #endif |
119 scoped_ptr<aura::RootWindowTransformer> transformer( | 120 scoped_ptr<aura::RootWindowTransformer> transformer( |
120 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); | 121 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); |
121 root->host()->SetRootWindowTransformer(transformer.Pass()); | 122 root->host()->SetRootWindowTransformer(transformer.Pass()); |
123 | |
124 internal::DisplayMode mode; | |
125 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode)) { | |
126 root->host()->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( | |
127 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | |
128 mode.refresh_rate)); | |
piman
2014/02/04 04:51:01
I think there's some cases where refresh_rate coul
sheu
2014/02/04 22:01:45
And the div-by-zero. Done.
| |
129 } | |
122 } | 130 } |
123 | 131 |
124 } // namespace | 132 } // namespace |
125 | 133 |
126 namespace internal { | 134 namespace internal { |
127 | 135 |
128 // A utility class to store/restore focused/active window | 136 // A utility class to store/restore focused/active window |
129 // when the display configuration has changed. | 137 // when the display configuration has changed. |
130 class FocusActivationStore { | 138 class FocusActivationStore { |
131 public: | 139 public: |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 std::string name = | 743 std::string name = |
736 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 744 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
737 gfx::AcceleratedWidget xwindow = | 745 gfx::AcceleratedWidget xwindow = |
738 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); | 746 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); |
739 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 747 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
740 } | 748 } |
741 #endif | 749 #endif |
742 } | 750 } |
743 | 751 |
744 } // namespace ash | 752 } // namespace ash |
OLD | NEW |