| 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 19 matching lines...) Expand all Loading... |
| 30 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
| 31 #include "ui/aura/client/capture_client.h" | 31 #include "ui/aura/client/capture_client.h" |
| 32 #include "ui/aura/client/focus_client.h" | 32 #include "ui/aura/client/focus_client.h" |
| 33 #include "ui/aura/client/screen_position_client.h" | 33 #include "ui/aura/client/screen_position_client.h" |
| 34 #include "ui/aura/window.h" | 34 #include "ui/aura/window.h" |
| 35 #include "ui/aura/window_event_dispatcher.h" | 35 #include "ui/aura/window_event_dispatcher.h" |
| 36 #include "ui/aura/window_property.h" | 36 #include "ui/aura/window_property.h" |
| 37 #include "ui/aura/window_tracker.h" | 37 #include "ui/aura/window_tracker.h" |
| 38 #include "ui/aura/window_tree_host.h" | 38 #include "ui/aura/window_tree_host.h" |
| 39 #include "ui/compositor/compositor.h" | 39 #include "ui/compositor/compositor.h" |
| 40 #include "ui/compositor/compositor_vsync_manager.h" | |
| 41 #include "ui/gfx/display.h" | 40 #include "ui/gfx/display.h" |
| 42 #include "ui/gfx/screen.h" | 41 #include "ui/gfx/screen.h" |
| 43 #include "ui/wm/public/activation_client.h" | 42 #include "ui/wm/public/activation_client.h" |
| 44 | 43 |
| 45 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
| 46 #include "ash/display/display_configurator_animation.h" | 45 #include "ash/display/display_configurator_animation.h" |
| 47 #include "base/sys_info.h" | 46 #include "base/sys_info.h" |
| 48 #include "base/time/time.h" | 47 #include "base/time/time.h" |
| 49 #endif // defined(OS_CHROMEOS) | 48 #endif // defined(OS_CHROMEOS) |
| 50 | 49 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 kCARDINAL, | 123 kCARDINAL, |
| 125 100 * display.device_scale_factor()); | 124 100 * display.device_scale_factor()); |
| 126 #endif | 125 #endif |
| 127 scoped_ptr<RootWindowTransformer> transformer( | 126 scoped_ptr<RootWindowTransformer> transformer( |
| 128 CreateRootWindowTransformerForDisplay(host->window(), display)); | 127 CreateRootWindowTransformerForDisplay(host->window(), display)); |
| 129 ash_host->SetRootWindowTransformer(transformer.Pass()); | 128 ash_host->SetRootWindowTransformer(transformer.Pass()); |
| 130 | 129 |
| 131 DisplayMode mode; | 130 DisplayMode mode; |
| 132 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && | 131 if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && |
| 133 mode.refresh_rate > 0.0f) { | 132 mode.refresh_rate > 0.0f) { |
| 134 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( | 133 host->compositor()->SetAuthoritativeVSyncInterval( |
| 135 base::TimeDelta::FromMicroseconds( | 134 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
| 136 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); | 135 mode.refresh_rate)); |
| 137 } | 136 } |
| 138 } | 137 } |
| 139 | 138 |
| 140 aura::Window* GetWindow(AshWindowTreeHost* ash_host) { | 139 aura::Window* GetWindow(AshWindowTreeHost* ash_host) { |
| 141 CHECK(ash_host->AsWindowTreeHost()); | 140 CHECK(ash_host->AsWindowTreeHost()); |
| 142 return ash_host->AsWindowTreeHost()->window(); | 141 return ash_host->AsWindowTreeHost()->window(); |
| 143 } | 142 } |
| 144 | 143 |
| 145 } // namespace | 144 } // namespace |
| 146 | 145 |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 std::string name = | 785 std::string name = |
| 787 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 786 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
| 788 gfx::AcceleratedWidget xwindow = | 787 gfx::AcceleratedWidget xwindow = |
| 789 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 788 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
| 790 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 789 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
| 791 } | 790 } |
| 792 #endif | 791 #endif |
| 793 } | 792 } |
| 794 | 793 |
| 795 } // namespace ash | 794 } // namespace ash |
| OLD | NEW |