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

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

Issue 1426993003: Ozone: Dont hardcode format to YUV when using Overlay Composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 4 years, 11 months 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer_base.h ('k') | ui/ozone/platform/drm/gpu/overlay_plane.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gbm_buffer_base.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/ozone/platform/drm/common/drm_util.h" 10 #include "ui/ozone/platform/drm/common/drm_util.h"
11 #include "ui/ozone/platform/drm/gpu/drm_device.h" 11 #include "ui/ozone/platform/drm/gpu/gbm_device.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 GbmBufferBase::GbmBufferBase(const scoped_refptr<DrmDevice>& drm, 15 GbmBufferBase::GbmBufferBase(const scoped_refptr<GbmDevice>& drm,
16 gbm_bo* bo, 16 gbm_bo* bo,
17 gfx::BufferFormat format, 17 gfx::BufferFormat format,
18 gfx::BufferUsage usage) 18 gfx::BufferUsage usage)
19 : drm_(drm), bo_(bo) { 19 : drm_(drm), bo_(bo) {
20 if (usage == gfx::BufferUsage::SCANOUT) { 20 if (usage == gfx::BufferUsage::SCANOUT) {
21 framebuffer_pixel_format_ = GetFourCCFormatForFramebuffer(format); 21 framebuffer_pixel_format_ = GetFourCCFormatForFramebuffer(format);
22 22
23 uint32_t handles[4] = {0}; 23 uint32_t handles[4] = {0};
24 handles[0] = gbm_bo_get_handle(bo).u32; 24 handles[0] = gbm_bo_get_handle(bo).u32;
25 uint32_t strides[4] = {0}; 25 uint32_t strides[4] = {0};
(...skipping 29 matching lines...) Expand all
55 uint32_t GbmBufferBase::GetFramebufferPixelFormat() const { 55 uint32_t GbmBufferBase::GetFramebufferPixelFormat() const {
56 DCHECK(framebuffer_); 56 DCHECK(framebuffer_);
57 return framebuffer_pixel_format_; 57 return framebuffer_pixel_format_;
58 } 58 }
59 59
60 bool GbmBufferBase::RequiresGlFinish() const { 60 bool GbmBufferBase::RequiresGlFinish() const {
61 return !drm_->is_primary_device(); 61 return !drm_->is_primary_device();
62 } 62 }
63 63
64 } // namespace ui 64 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer_base.h ('k') | ui/ozone/platform/drm/gpu/overlay_plane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698