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

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

Issue 2576263002: ozone: Allocate scanout buffer according to KMS modifiers (Closed)
Patch Set: ozone: Allocate scanout buffer according to KMS modifiers Created 4 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_buffer.h" 5 #include "ui/ozone/platform/drm/gpu/drm_buffer.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkSurface.h" 10 #include "third_party/skia/include/core/SkSurface.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 if (should_register_framebuffer) { 66 if (should_register_framebuffer) {
67 uint32_t handles[4] = {0}; 67 uint32_t handles[4] = {0};
68 handles[0] = handle_; 68 handles[0] = handle_;
69 uint32_t strides[4] = {0}; 69 uint32_t strides[4] = {0};
70 strides[0] = stride_; 70 strides[0] = stride_;
71 uint32_t offsets[4] = {0}; 71 uint32_t offsets[4] = {0};
72 fb_pixel_format_ = GetFourCCCodeForSkColorType(info.colorType()); 72 fb_pixel_format_ = GetFourCCCodeForSkColorType(info.colorType());
73 if (!drm_->AddFramebuffer2(info.width(), info.height(), fb_pixel_format_, 73 if (!drm_->AddFramebuffer2(info.width(), info.height(), fb_pixel_format_,
74 handles, strides, offsets, &framebuffer_, 0)) { 74 handles, strides, offsets, NULL, &framebuffer_, 0 )) {
Daniele Castagna 2016/12/16 00:27:41 nit: nullptr
hoegsberg1 2016/12/17 01:10:49 Acknowledged.
75 PLOG(ERROR) << "DrmBuffer: AddFramebuffer2: handle " << handle_; 75 PLOG(ERROR) << "DrmBuffer: AddFramebuffer2: handle " << handle_;
76 return false; 76 return false;
77 } 77 }
78 } 78 }
79 79
80 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_); 80 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_);
81 if (!surface_) { 81 if (!surface_) {
82 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_; 82 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_;
83 return false; 83 return false;
84 } 84 }
(...skipping 23 matching lines...) Expand all
108 108
109 const DrmDevice* DrmBuffer::GetDrmDevice() const { 109 const DrmDevice* DrmBuffer::GetDrmDevice() const {
110 return drm_.get(); 110 return drm_.get();
111 } 111 }
112 112
113 bool DrmBuffer::RequiresGlFinish() const { 113 bool DrmBuffer::RequiresGlFinish() const {
114 return false; 114 return false;
115 } 115 }
116 116
117 } // namespace ui 117 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698