Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_window.cc

Issue 1483633002: ozone: support gfx::BufferFormat::RGBX_8888 as a native pixmap format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep hardware overlay creating 24 bits plane Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698