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 "ui/ozone/platform/dri/dri_gpu_platform_support.h" | 5 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 #include "ui/display/types/display_mode.h" | 10 #include "ui/display/types/display_mode.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 mode_param.refresh_rate); | 298 mode_param.refresh_rate); |
299 | 299 |
300 if (!mode) { | 300 if (!mode) { |
301 LOG(ERROR) << "Failed to find mode: size=" << mode_param.size.ToString() | 301 LOG(ERROR) << "Failed to find mode: size=" << mode_param.size.ToString() |
302 << " is_interlaced=" << mode_param.is_interlaced | 302 << " is_interlaced=" << mode_param.is_interlaced |
303 << " refresh_rate=" << mode_param.refresh_rate; | 303 << " refresh_rate=" << mode_param.refresh_rate; |
304 sender_->Send(new OzoneHostMsg_DisplayConfigured(id, false)); | 304 sender_->Send(new OzoneHostMsg_DisplayConfigured(id, false)); |
305 return; | 305 return; |
306 } | 306 } |
307 | 307 |
308 sender_->Send(new OzoneHostMsg_DisplayConfigured( | 308 bool success = ndd_->Configure(*display, mode, origin); |
309 id, ndd_->Configure(*display, mode, origin))); | 309 if (success) { |
| 310 display->set_origin(origin); |
| 311 display->set_current_mode(mode); |
| 312 } |
| 313 |
| 314 sender_->Send(new OzoneHostMsg_DisplayConfigured(id, success)); |
310 } | 315 } |
311 | 316 |
312 void DriGpuPlatformSupport::OnDisableNativeDisplay(int64_t id) { | 317 void DriGpuPlatformSupport::OnDisableNativeDisplay(int64_t id) { |
313 DisplaySnapshot* display = ndd_->FindDisplaySnapshot(id); | 318 DisplaySnapshot* display = ndd_->FindDisplaySnapshot(id); |
314 bool success = false; | 319 bool success = false; |
315 if (display) | 320 if (display) |
316 success = ndd_->Configure(*display, NULL, gfx::Point()); | 321 success = ndd_->Configure(*display, NULL, gfx::Point()); |
317 else | 322 else |
318 LOG(ERROR) << "There is no display with ID " << id; | 323 LOG(ERROR) << "There is no display with ID " << id; |
319 | 324 |
(...skipping 19 matching lines...) Expand all Loading... |
339 void DriGpuPlatformSupport::RelinquishGpuResources( | 344 void DriGpuPlatformSupport::RelinquishGpuResources( |
340 const base::Closure& callback) { | 345 const base::Closure& callback) { |
341 callback.Run(); | 346 callback.Run(); |
342 } | 347 } |
343 | 348 |
344 IPC::MessageFilter* DriGpuPlatformSupport::GetMessageFilter() { | 349 IPC::MessageFilter* DriGpuPlatformSupport::GetMessageFilter() { |
345 return filter_.get(); | 350 return filter_.get(); |
346 } | 351 } |
347 | 352 |
348 } // namespace ui | 353 } // namespace ui |
OLD | NEW |