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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 host->GetAcceleratedWidget(), info.rotation(), scale); | 141 host->GetAcceleratedWidget(), info.rotation(), scale); |
143 #endif | 142 #endif |
144 #endif | 143 #endif |
145 scoped_ptr<RootWindowTransformer> transformer( | 144 scoped_ptr<RootWindowTransformer> transformer( |
146 CreateRootWindowTransformerForDisplay(host->window(), display)); | 145 CreateRootWindowTransformerForDisplay(host->window(), display)); |
147 ash_host->SetRootWindowTransformer(transformer.Pass()); | 146 ash_host->SetRootWindowTransformer(transformer.Pass()); |
148 | 147 |
149 DisplayMode mode = | 148 DisplayMode mode = |
150 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); | 149 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); |
151 if (mode.refresh_rate > 0.0f) { | 150 if (mode.refresh_rate > 0.0f) { |
152 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( | 151 host->compositor()->SetAuthoritativeVSyncInterval( |
153 base::TimeDelta::FromMicroseconds( | 152 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
154 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); | 153 mode.refresh_rate)); |
155 } | 154 } |
156 | 155 |
157 // Just movnig the display requires the full redraw. | 156 // Just movnig the display requires the full redraw. |
158 // chrome-os-partner:33558. | 157 // chrome-os-partner:33558. |
159 host->compositor()->ScheduleFullRedraw(); | 158 host->compositor()->ScheduleFullRedraw(); |
160 } | 159 } |
161 | 160 |
162 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, | 161 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, |
163 const gfx::Display& display) { | 162 const gfx::Display& display) { |
164 #if defined(OS_CHROMEOS) && defined(USE_OZONE) | 163 #if defined(OS_CHROMEOS) && defined(USE_OZONE) |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 std::string name = | 809 std::string name = |
811 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 810 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
812 gfx::AcceleratedWidget xwindow = | 811 gfx::AcceleratedWidget xwindow = |
813 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 812 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
814 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 813 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
815 } | 814 } |
816 #endif | 815 #endif |
817 } | 816 } |
818 | 817 |
819 } // namespace ash | 818 } // namespace ash |
OLD | NEW |