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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); | 112 ui::SetIntProperty(xwindow, kInternalProp, kCARDINAL, internal); |
113 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); | 113 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); |
114 ui::SetIntProperty(xwindow, | 114 ui::SetIntProperty(xwindow, |
115 kScaleFactorProp, | 115 kScaleFactorProp, |
116 kCARDINAL, | 116 kCARDINAL, |
117 100 * display.device_scale_factor()); | 117 100 * display.device_scale_factor()); |
118 #endif | 118 #endif |
119 scoped_ptr<aura::RootWindowTransformer> transformer( | 119 scoped_ptr<aura::RootWindowTransformer> transformer( |
120 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); | 120 internal::CreateRootWindowTransformerForDisplay(root->window(), display)); |
121 root->host()->SetRootWindowTransformer(transformer.Pass()); | 121 root->host()->SetRootWindowTransformer(transformer.Pass()); |
| 122 gfx::Size resolution; |
| 123 float frame_rate; |
| 124 if (GetDisplayManager()->GetSelectedResolutionForDisplayId( |
| 125 display.id(), &resolution, &frame_rate)) { |
| 126 root->host()->compositor()->OnUpdateVSyncParameters( |
| 127 base::TimeTicks(), |
| 128 base::TimeDelta::FromMicroseconds(frame_rate * |
| 129 base::Time::kMicrosecondsPerSecond), |
| 130 true); |
| 131 } |
122 } | 132 } |
123 | 133 |
124 } // namespace | 134 } // namespace |
125 | 135 |
126 namespace internal { | 136 namespace internal { |
127 | 137 |
128 // A utility class to store/restore focused/active window | 138 // A utility class to store/restore focused/active window |
129 // when the display configuration has changed. | 139 // when the display configuration has changed. |
130 class FocusActivationStore { | 140 class FocusActivationStore { |
131 public: | 141 public: |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 std::string name = | 745 std::string name = |
736 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 746 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
737 gfx::AcceleratedWidget xwindow = | 747 gfx::AcceleratedWidget xwindow = |
738 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); | 748 root_windows[i]->GetDispatcher()->host()->GetAcceleratedWidget(); |
739 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 749 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
740 } | 750 } |
741 #endif | 751 #endif |
742 } | 752 } |
743 | 753 |
744 } // namespace ash | 754 } // namespace ash |
OLD | NEW |