| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/platform_display_default.h" | 5 #include "services/ui/ws/platform_display_default.h" |
| 6 | 6 |
| 7 #include "gpu/ipc/client/gpu_channel_host.h" | 7 #include "gpu/ipc/client/gpu_channel_host.h" |
| 8 #include "services/ui/display/platform_screen.h" | 8 #include "services/ui/display/platform_screen.h" |
| 9 #include "services/ui/ws/platform_display_init_params.h" | 9 #include "services/ui/ws/platform_display_init_params.h" |
| 10 #include "services/ui/ws/server_window.h" | 10 #include "services/ui/ws/server_window.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 gfx::Rect PlatformDisplayDefault::GetBounds() const { | 124 gfx::Rect PlatformDisplayDefault::GetBounds() const { |
| 125 return metrics_.bounds; | 125 return metrics_.bounds; |
| 126 } | 126 } |
| 127 | 127 |
| 128 FrameGenerator* PlatformDisplayDefault::GetFrameGenerator() { | 128 FrameGenerator* PlatformDisplayDefault::GetFrameGenerator() { |
| 129 return frame_generator_.get(); | 129 return frame_generator_.get(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void PlatformDisplayDefault::OnGpuChannelEstablished( | |
| 133 scoped_refptr<gpu::GpuChannelHost> channel) { | |
| 134 frame_generator_->OnGpuChannelEstablished(channel); | |
| 135 } | |
| 136 | |
| 137 bool PlatformDisplayDefault::UpdateViewportMetrics( | 132 bool PlatformDisplayDefault::UpdateViewportMetrics( |
| 138 const display::ViewportMetrics& metrics) { | 133 const display::ViewportMetrics& metrics) { |
| 139 if (metrics_ == metrics) | 134 if (metrics_ == metrics) |
| 140 return false; | 135 return false; |
| 141 | 136 |
| 142 gfx::Rect bounds = platform_window_->GetBounds(); | 137 gfx::Rect bounds = platform_window_->GetBounds(); |
| 143 if (bounds.size() != metrics.pixel_size) { | 138 if (bounds.size() != metrics.pixel_size) { |
| 144 bounds.set_size(metrics.pixel_size); | 139 bounds.set_size(metrics.pixel_size); |
| 145 platform_window_->SetBounds(bounds); | 140 platform_window_->SetBounds(bounds); |
| 146 } | 141 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 239 } |
| 245 | 240 |
| 246 void PlatformDisplayDefault::OnActivationChanged(bool active) {} | 241 void PlatformDisplayDefault::OnActivationChanged(bool active) {} |
| 247 | 242 |
| 248 bool PlatformDisplayDefault::IsInHighContrastMode() { | 243 bool PlatformDisplayDefault::IsInHighContrastMode() { |
| 249 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 244 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 250 } | 245 } |
| 251 | 246 |
| 252 } // namespace ws | 247 } // namespace ws |
| 253 } // namespace ui | 248 } // namespace ui |
| OLD | NEW |