| 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/drm/gpu/screen_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
| 6 | 6 |
| 7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 if (window) { | 338 if (window) { |
| 339 const OverlayPlane* primary = window->GetLastModesetBuffer(); | 339 const OverlayPlane* primary = window->GetLastModesetBuffer(); |
| 340 const DrmDevice* drm = controller->GetAllocationDrmDevice().get(); | 340 const DrmDevice* drm = controller->GetAllocationDrmDevice().get(); |
| 341 if (primary && primary->buffer->GetSize() == bounds.size() && | 341 if (primary && primary->buffer->GetSize() == bounds.size() && |
| 342 primary->buffer->GetDrmDevice() == drm) | 342 primary->buffer->GetDrmDevice() == drm) |
| 343 return *primary; | 343 return *primary; |
| 344 } | 344 } |
| 345 | 345 |
| 346 gfx::BufferFormat format = display::DisplaySnapshot::PrimaryFormat(); | 346 gfx::BufferFormat format = display::DisplaySnapshot::PrimaryFormat(); |
| 347 scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice(); | 347 scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice(); |
| 348 uint32_t fourcc_format = ui::GetFourCCFormatForFramebuffer(format); | 348 uint32_t fourcc_format = ui::GetFourCCFormatForOpaqueFramebuffer(format); |
| 349 scoped_refptr<ScanoutBuffer> buffer = | 349 scoped_refptr<ScanoutBuffer> buffer = |
| 350 buffer_generator_->Create(drm, fourcc_format, bounds.size()); | 350 buffer_generator_->Create(drm, fourcc_format, bounds.size()); |
| 351 if (!buffer) { | 351 if (!buffer) { |
| 352 LOG(ERROR) << "Failed to create scanout buffer"; | 352 LOG(ERROR) << "Failed to create scanout buffer"; |
| 353 return OverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID, gfx::Rect(), | 353 return OverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID, gfx::Rect(), |
| 354 gfx::RectF()); | 354 gfx::RectF()); |
| 355 } | 355 } |
| 356 | 356 |
| 357 FillModesetBuffer(drm, controller, buffer.get()); | 357 FillModesetBuffer(drm, controller, buffer.get()); |
| 358 return OverlayPlane(buffer); | 358 return OverlayPlane(buffer); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 389 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { | 389 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { |
| 390 for (auto& pair : window_map_) { | 390 for (auto& pair : window_map_) { |
| 391 if (pair.second->bounds() == bounds) | 391 if (pair.second->bounds() == bounds) |
| 392 return pair.second.get(); | 392 return pair.second.get(); |
| 393 } | 393 } |
| 394 | 394 |
| 395 return nullptr; | 395 return nullptr; |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace ui | 398 } // namespace ui |
| OLD | NEW |