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" |
39 #include "ui/gfx/display.h" | 40 #include "ui/gfx/display.h" |
40 #include "ui/gfx/screen.h" | 41 #include "ui/gfx/screen.h" |
41 #include "ui/wm/core/coordinate_conversion.h" | 42 #include "ui/wm/core/coordinate_conversion.h" |
42 #include "ui/wm/public/activation_client.h" | 43 #include "ui/wm/public/activation_client.h" |
43 | 44 |
44 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
45 #include "ash/display/display_configurator_animation.h" | 46 #include "ash/display/display_configurator_animation.h" |
46 #include "base/sys_info.h" | 47 #include "base/sys_info.h" |
47 #include "base/time/time.h" | 48 #include "base/time/time.h" |
48 #endif // defined(OS_CHROMEOS) | 49 #endif // defined(OS_CHROMEOS) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 host->GetAcceleratedWidget(), info.rotation(), scale); | 143 host->GetAcceleratedWidget(), info.rotation(), scale); |
143 #endif | 144 #endif |
144 #endif | 145 #endif |
145 scoped_ptr<RootWindowTransformer> transformer( | 146 scoped_ptr<RootWindowTransformer> transformer( |
146 CreateRootWindowTransformerForDisplay(host->window(), display)); | 147 CreateRootWindowTransformerForDisplay(host->window(), display)); |
147 ash_host->SetRootWindowTransformer(transformer.Pass()); | 148 ash_host->SetRootWindowTransformer(transformer.Pass()); |
148 | 149 |
149 DisplayMode mode = | 150 DisplayMode mode = |
150 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); | 151 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); |
151 if (mode.refresh_rate > 0.0f) { | 152 if (mode.refresh_rate > 0.0f) { |
152 host->compositor()->SetAuthoritativeVSyncInterval( | 153 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( |
153 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 154 base::TimeDelta::FromMicroseconds( |
154 mode.refresh_rate)); | 155 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); |
155 } | 156 } |
156 | 157 |
157 // Just movnig the display requires the full redraw. | 158 // Just movnig the display requires the full redraw. |
158 // chrome-os-partner:33558. | 159 // chrome-os-partner:33558. |
159 host->compositor()->ScheduleFullRedraw(); | 160 host->compositor()->ScheduleFullRedraw(); |
160 } | 161 } |
161 | 162 |
162 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, | 163 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, |
163 const gfx::Display& display) { | 164 const gfx::Display& display) { |
164 #if defined(OS_CHROMEOS) && defined(USE_OZONE) | 165 #if defined(OS_CHROMEOS) && defined(USE_OZONE) |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 std::string name = | 858 std::string name = |
858 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 859 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
859 gfx::AcceleratedWidget xwindow = | 860 gfx::AcceleratedWidget xwindow = |
860 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 861 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
861 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 862 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
862 } | 863 } |
863 #endif | 864 #endif |
864 } | 865 } |
865 | 866 |
866 } // namespace ash | 867 } // namespace ash |
OLD | NEW |