| 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/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 scale *= kCursorMultiplierForExternalDisplays; | 129 scale *= kCursorMultiplierForExternalDisplays; |
| 130 | 130 |
| 131 ui::CursorController::GetInstance()->SetCursorConfigForWindow( | 131 ui::CursorController::GetInstance()->SetCursorConfigForWindow( |
| 132 host->GetAcceleratedWidget(), info.GetActiveRotation(), scale); | 132 host->GetAcceleratedWidget(), info.GetActiveRotation(), scale); |
| 133 #endif | 133 #endif |
| 134 #endif | 134 #endif |
| 135 std::unique_ptr<RootWindowTransformer> transformer( | 135 std::unique_ptr<RootWindowTransformer> transformer( |
| 136 CreateRootWindowTransformerForDisplay(host->window(), display)); | 136 CreateRootWindowTransformerForDisplay(host->window(), display)); |
| 137 ash_host->SetRootWindowTransformer(std::move(transformer)); | 137 ash_host->SetRootWindowTransformer(std::move(transformer)); |
| 138 | 138 |
| 139 DisplayMode mode = | 139 scoped_refptr<DisplayMode> mode = |
| 140 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); | 140 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); |
| 141 if (mode.refresh_rate > 0.0f) { | 141 if (mode && mode->refresh_rate() > 0.0f) { |
| 142 host->compositor()->SetAuthoritativeVSyncInterval( | 142 host->compositor()->SetAuthoritativeVSyncInterval( |
| 143 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 143 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
| 144 mode.refresh_rate)); | 144 mode->refresh_rate())); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Just movnig the display requires the full redraw. | 147 // Just movnig the display requires the full redraw. |
| 148 // chrome-os-partner:33558. | 148 // chrome-os-partner:33558. |
| 149 host->compositor()->ScheduleFullRedraw(); | 149 host->compositor()->ScheduleFullRedraw(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host) { | 152 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host) { |
| 153 #if defined(OS_CHROMEOS) && defined(USE_OZONE) | 153 #if defined(OS_CHROMEOS) && defined(USE_OZONE) |
| 154 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); | 154 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 SetDisplayPropertiesOnHost(ash_host, display); | 845 SetDisplayPropertiesOnHost(ash_host, display); |
| 846 | 846 |
| 847 #if defined(OS_CHROMEOS) | 847 #if defined(OS_CHROMEOS) |
| 848 if (switches::ConstrainPointerToRoot()) | 848 if (switches::ConstrainPointerToRoot()) |
| 849 ash_host->ConfineCursorToRootWindow(); | 849 ash_host->ConfineCursorToRootWindow(); |
| 850 #endif | 850 #endif |
| 851 return ash_host; | 851 return ash_host; |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace ash | 854 } // namespace ash |
| OLD | NEW |