| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "services/ui/ws/platform_display.h" |
| 6 | 6 |
| 7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/ipc/quads.mojom.h" | 9 #include "cc/ipc/quads.mojom.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 bool DefaultPlatformDisplay::IsPrimaryDisplay() const { | 152 bool DefaultPlatformDisplay::IsPrimaryDisplay() const { |
| 153 return display::PlatformScreen::GetInstance()->GetPrimaryDisplayId() == id_; | 153 return display::PlatformScreen::GetInstance()->GetPrimaryDisplayId() == id_; |
| 154 } | 154 } |
| 155 | 155 |
| 156 void DefaultPlatformDisplay::OnGpuChannelEstablished( | 156 void DefaultPlatformDisplay::OnGpuChannelEstablished( |
| 157 scoped_refptr<gpu::GpuChannelHost> channel) { | 157 scoped_refptr<gpu::GpuChannelHost> channel) { |
| 158 frame_generator_->OnGpuChannelEstablished(channel); | 158 frame_generator_->OnGpuChannelEstablished(channel); |
| 159 } | 159 } |
| 160 | 160 |
| 161 FrameGenerator* DefaultPlatformDisplay::GetFrameGenerator() { |
| 162 return frame_generator_.get(); |
| 163 } |
| 164 |
| 161 bool DefaultPlatformDisplay::UpdateViewportMetrics( | 165 bool DefaultPlatformDisplay::UpdateViewportMetrics( |
| 162 const display::ViewportMetrics& metrics) { | 166 const display::ViewportMetrics& metrics) { |
| 163 if (metrics_ == metrics) | 167 if (metrics_ == metrics) |
| 164 return false; | 168 return false; |
| 165 | 169 |
| 166 gfx::Rect bounds = platform_window_->GetBounds(); | 170 gfx::Rect bounds = platform_window_->GetBounds(); |
| 167 if (bounds.size() != metrics.pixel_size) { | 171 if (bounds.size() != metrics.pixel_size) { |
| 168 bounds.set_size(metrics.pixel_size); | 172 bounds.set_size(metrics.pixel_size); |
| 169 platform_window_->SetBounds(bounds); | 173 platform_window_->SetBounds(bounds); |
| 170 } | 174 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 270 |
| 267 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} | 271 void DefaultPlatformDisplay::OnActivationChanged(bool active) {} |
| 268 | 272 |
| 269 bool DefaultPlatformDisplay::IsInHighContrastMode() { | 273 bool DefaultPlatformDisplay::IsInHighContrastMode() { |
| 270 return delegate_ ? delegate_->IsInHighContrastMode() : false; | 274 return delegate_ ? delegate_->IsInHighContrastMode() : false; |
| 271 } | 275 } |
| 272 | 276 |
| 273 } // namespace ws | 277 } // namespace ws |
| 274 | 278 |
| 275 } // namespace ui | 279 } // namespace ui |
| OLD | NEW |