| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = GetFourCCFormatFromBufferFormat(overlay.format); |
| 162 // We always use a storage type of XRGB, even if the pixel format | 162 // We always use a storage type of XRGB, even if the pixel format |
| 163 // is ARGB. | 163 // is ARGB. |
| 164 if (format == DRM_FORMAT_ARGB8888) | 164 if (format == DRM_FORMAT_ARGB8888 || format == DRM_FORMAT_ABGR8888) |
| 165 format = DRM_FORMAT_XRGB8888; | 165 format = DRM_FORMAT_XRGB8888; |
| 166 | 166 |
| 167 if (plane.buffer->GetFramebufferPixelFormat() == format && | 167 if (plane.buffer->GetFramebufferPixelFormat() == format && |
| 168 plane.z_order == overlay.plane_z_order && | 168 plane.z_order == overlay.plane_z_order && |
| 169 plane.display_bounds == overlay.display_rect && | 169 plane.display_bounds == overlay.display_rect && |
| 170 plane.buffer->GetSize() == size) { | 170 plane.buffer->GetSize() == size) { |
| 171 buffer = plane.buffer; | 171 buffer = plane.buffer; |
| 172 break; | 172 break; |
| 173 } | 173 } |
| 174 } | 174 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (!cursor_buffers_[i]->Initialize( | 297 if (!cursor_buffers_[i]->Initialize( |
| 298 info, false /* should_register_framebuffer */)) { | 298 info, false /* should_register_framebuffer */)) { |
| 299 LOG(FATAL) << "Failed to initialize cursor buffer"; | 299 LOG(FATAL) << "Failed to initialize cursor buffer"; |
| 300 return; | 300 return; |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace ui | 306 } // namespace ui |
| OLD | NEW |