| 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/drm_window.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
| 6 | 6 |
| 7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 OverlayPlaneList compatible_test_list; | 152 OverlayPlaneList compatible_test_list; |
| 153 scoped_refptr<DrmDevice> drm = controller_->GetAllocationDrmDevice(); | 153 scoped_refptr<DrmDevice> drm = controller_->GetAllocationDrmDevice(); |
| 154 for (const auto& overlay : overlays) { | 154 for (const auto& overlay : overlays) { |
| 155 OverlayCheck_Params overlay_params(overlay); | 155 OverlayCheck_Params overlay_params(overlay); |
| 156 gfx::Size size = | 156 gfx::Size size = |
| 157 (overlay.plane_z_order == 0) ? bounds().size() : overlay.buffer_size; | 157 (overlay.plane_z_order == 0) ? bounds().size() : overlay.buffer_size; |
| 158 scoped_refptr<ScanoutBuffer> buffer; | 158 scoped_refptr<ScanoutBuffer> buffer; |
| 159 // Check if we can re-use existing buffers. | 159 // Check if we can re-use existing buffers. |
| 160 for (const auto& plane : last_submitted_planes_) { | 160 for (const auto& plane : last_submitted_planes_) { |
| 161 uint32_t format = GetFourCCFormatFromBufferFormat(overlay.format); | 161 uint32_t format = GetFourCCFormatForFramebuffer(overlay.format); |
| 162 // We always use a storage type of XRGB, even if the pixel format | |
| 163 // is ARGB. | |
| 164 if (format == DRM_FORMAT_ARGB8888) | |
| 165 format = DRM_FORMAT_XRGB8888; | |
| 166 | |
| 167 if (plane.buffer->GetFramebufferPixelFormat() == format && | 162 if (plane.buffer->GetFramebufferPixelFormat() == format && |
| 168 plane.z_order == overlay.plane_z_order && | 163 plane.z_order == overlay.plane_z_order && |
| 169 plane.display_bounds == overlay.display_rect && | 164 plane.display_bounds == overlay.display_rect && |
| 170 plane.buffer->GetSize() == size) { | 165 plane.buffer->GetSize() == size) { |
| 171 buffer = plane.buffer; | 166 buffer = plane.buffer; |
| 172 break; | 167 break; |
| 173 } | 168 } |
| 174 } | 169 } |
| 175 | 170 |
| 176 if (!buffer) | 171 if (!buffer) |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (!cursor_buffers_[i]->Initialize( | 292 if (!cursor_buffers_[i]->Initialize( |
| 298 info, false /* should_register_framebuffer */)) { | 293 info, false /* should_register_framebuffer */)) { |
| 299 LOG(FATAL) << "Failed to initialize cursor buffer"; | 294 LOG(FATAL) << "Failed to initialize cursor buffer"; |
| 300 return; | 295 return; |
| 301 } | 296 } |
| 302 } | 297 } |
| 303 } | 298 } |
| 304 } | 299 } |
| 305 | 300 |
| 306 } // namespace ui | 301 } // namespace ui |
| OLD | NEW |