Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
| 30 #include "ui/aura/client/capture_client.h" | 30 #include "ui/aura/client/capture_client.h" |
| 31 #include "ui/aura/client/focus_client.h" | 31 #include "ui/aura/client/focus_client.h" |
| 32 #include "ui/aura/client/screen_position_client.h" | 32 #include "ui/aura/client/screen_position_client.h" |
| 33 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 34 #include "ui/aura/window_event_dispatcher.h" | 34 #include "ui/aura/window_event_dispatcher.h" |
| 35 #include "ui/aura/window_property.h" | 35 #include "ui/aura/window_property.h" |
| 36 #include "ui/aura/window_tracker.h" | 36 #include "ui/aura/window_tracker.h" |
| 37 #include "ui/aura/window_tree_host.h" | 37 #include "ui/aura/window_tree_host.h" |
| 38 #include "ui/compositor/compositor.h" | 38 #include "ui/compositor/compositor.h" |
| 39 #include "ui/compositor/compositor_vsync_manager.h" | |
| 40 #include "ui/gfx/display.h" | 39 #include "ui/gfx/display.h" |
| 41 #include "ui/gfx/screen.h" | 40 #include "ui/gfx/screen.h" |
| 42 #include "ui/wm/public/activation_client.h" | 41 #include "ui/wm/public/activation_client.h" |
| 43 | 42 |
| 44 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
| 45 #include "ash/display/display_configurator_animation.h" | 44 #include "ash/display/display_configurator_animation.h" |
| 46 #include "base/sys_info.h" | 45 #include "base/sys_info.h" |
| 47 #include "base/time/time.h" | 46 #include "base/time/time.h" |
| 48 #endif // defined(OS_CHROMEOS) | 47 #endif // defined(OS_CHROMEOS) |
| 49 | 48 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); | 119 ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, xrandr_rotation); |
| 121 ui::SetIntProperty(xwindow, | 120 ui::SetIntProperty(xwindow, |
| 122 kScaleFactorProp, | 121 kScaleFactorProp, |
| 123 kCARDINAL, | 122 kCARDINAL, |
| 124 100 * display.device_scale_factor()); | 123 100 * display.device_scale_factor()); |
| 125 #endif | 124 #endif |
| 126 scoped_ptr<RootWindowTransformer> transformer( | 125 scoped_ptr<RootWindowTransformer> transformer( |
| 127 CreateRootWindowTransformerForDisplay(host->window(), display)); | 126 CreateRootWindowTransformerForDisplay(host->window(), display)); |
| 128 ash_host->SetRootWindowTransformer(transformer.Pass()); | 127 ash_host->SetRootWindowTransformer(transformer.Pass()); |
| 129 | 128 |
| 129 /* | |
| 130 * Should update this to somewhere. | |
|
brianderson
2014/08/21 00:13:59
Let's route it to the cc::Scheduler. Only the Brow
simonhong
2014/08/26 08:24:47
Done.
| |
| 130 DisplayMode mode; | 131 DisplayMode mode; |
| 131 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && | 132 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && |
| 132 mode.refresh_rate > 0.0f) { | 133 mode.refresh_rate > 0.0f) { |
| 133 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( | 134 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( |
| 134 base::TimeDelta::FromMicroseconds( | 135 base::TimeDelta::FromMicroseconds( |
| 135 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); | 136 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); |
| 136 } | 137 } |
| 138 */ | |
| 137 } | 139 } |
| 138 | 140 |
| 139 aura::Window* GetWindow(AshWindowTreeHost* ash_host) { | 141 aura::Window* GetWindow(AshWindowTreeHost* ash_host) { |
| 140 CHECK(ash_host->AsWindowTreeHost()); | 142 CHECK(ash_host->AsWindowTreeHost()); |
| 141 return ash_host->AsWindowTreeHost()->window(); | 143 return ash_host->AsWindowTreeHost()->window(); |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace | 146 } // namespace |
| 145 | 147 |
| 146 // A utility class to store/restore focused/active window | 148 // A utility class to store/restore focused/active window |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 775 std::string name = | 777 std::string name = |
| 776 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 778 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
| 777 gfx::AcceleratedWidget xwindow = | 779 gfx::AcceleratedWidget xwindow = |
| 778 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 780 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
| 779 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 781 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
| 780 } | 782 } |
| 781 #endif | 783 #endif |
| 782 } | 784 } |
| 783 | 785 |
| 784 } // namespace ash | 786 } // namespace ash |
| OLD | NEW |