| 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" |
| 40 #include "ui/gfx/display.h" | 41 #include "ui/gfx/display.h" |
| 41 #include "ui/gfx/screen.h" | 42 #include "ui/gfx/screen.h" |
| 42 #include "ui/wm/core/coordinate_conversion.h" | 43 #include "ui/wm/core/coordinate_conversion.h" |
| 43 #include "ui/wm/public/activation_client.h" | 44 #include "ui/wm/public/activation_client.h" |
| 44 | 45 |
| 45 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 46 #include "ash/display/display_configurator_animation.h" | 47 #include "ash/display/display_configurator_animation.h" |
| 47 #include "base/sys_info.h" | 48 #include "base/sys_info.h" |
| 48 #include "base/time/time.h" | 49 #include "base/time/time.h" |
| 49 #endif // defined(OS_CHROMEOS) | 50 #endif // defined(OS_CHROMEOS) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 host->GetAcceleratedWidget(), info.GetActiveRotation(), scale); | 144 host->GetAcceleratedWidget(), info.GetActiveRotation(), scale); |
| 144 #endif | 145 #endif |
| 145 #endif | 146 #endif |
| 146 scoped_ptr<RootWindowTransformer> transformer( | 147 scoped_ptr<RootWindowTransformer> transformer( |
| 147 CreateRootWindowTransformerForDisplay(host->window(), display)); | 148 CreateRootWindowTransformerForDisplay(host->window(), display)); |
| 148 ash_host->SetRootWindowTransformer(transformer.Pass()); | 149 ash_host->SetRootWindowTransformer(transformer.Pass()); |
| 149 | 150 |
| 150 DisplayMode mode = | 151 DisplayMode mode = |
| 151 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); | 152 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); |
| 152 if (mode.refresh_rate > 0.0f) { | 153 if (mode.refresh_rate > 0.0f) { |
| 153 host->compositor()->SetAuthoritativeVSyncInterval( | 154 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( |
| 154 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 155 base::TimeDelta::FromMicroseconds( |
| 155 mode.refresh_rate)); | 156 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); |
| 156 } | 157 } |
| 157 | 158 |
| 158 // Just movnig the display requires the full redraw. | 159 // Just movnig the display requires the full redraw. |
| 159 // chrome-os-partner:33558. | 160 // chrome-os-partner:33558. |
| 160 host->compositor()->ScheduleFullRedraw(); | 161 host->compositor()->ScheduleFullRedraw(); |
| 161 } | 162 } |
| 162 | 163 |
| 163 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host) { | 164 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host) { |
| 164 #if defined(OS_CHROMEOS) && defined(USE_OZONE) | 165 #if defined(OS_CHROMEOS) && defined(USE_OZONE) |
| 165 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); | 166 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 Shell::GetInstance()->display_configurator_animation() | 887 Shell::GetInstance()->display_configurator_animation() |
| 887 ->StartFadeInAnimation(); | 888 ->StartFadeInAnimation(); |
| 888 #endif | 889 #endif |
| 889 } | 890 } |
| 890 | 891 |
| 891 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { | 892 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { |
| 892 GetDisplayManager()->SetMirrorMode(mirror); | 893 GetDisplayManager()->SetMirrorMode(mirror); |
| 893 } | 894 } |
| 894 | 895 |
| 895 } // namespace ash | 896 } // namespace ash |
| OLD | NEW |