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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_buffer.cc

Issue 1071273002: NotForReview: Implement zero/one-copy texture for ozone freon using Intel DRM Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/gpu/gbm_buffer.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index 4a4380c8ecfcbc9c5afa21ecb60f148692359edc..aa491943cdc26237e4424554fe9559de51cfac3c 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -19,7 +19,7 @@ namespace {
int GetGbmFormatFromBufferFormat(SurfaceFactoryOzone::BufferFormat fmt) {
switch (fmt) {
- case SurfaceFactoryOzone::RGBA_8888:
+ case SurfaceFactoryOzone::BGRA_8888:
return GBM_BO_FORMAT_ARGB8888;
case SurfaceFactoryOzone::RGBX_8888:
return GBM_BO_FORMAT_XRGB8888;
@@ -31,10 +31,8 @@ int GetGbmFormatFromBufferFormat(SurfaceFactoryOzone::BufferFormat fmt) {
} // namespace
-GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
- gbm_bo* bo,
- bool scanout)
- : GbmBufferBase(gbm, bo, scanout) {
+GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm, gbm_bo* bo)
+ : GbmBufferBase(gbm, bo) {
}
GbmBuffer::~GbmBuffer() {
@@ -46,21 +44,18 @@ GbmBuffer::~GbmBuffer() {
scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer(
const scoped_refptr<GbmDevice>& gbm,
SurfaceFactoryOzone::BufferFormat format,
- const gfx::Size& size,
- bool scanout) {
+ const gfx::Size& size) {
TRACE_EVENT2("drm", "GbmBuffer::CreateBuffer", "device",
gbm->device_path().value(), "size", size.ToString());
- unsigned flags = GBM_BO_USE_RENDERING;
- if (scanout)
- flags |= GBM_BO_USE_SCANOUT;
+ unsigned flags = GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT;
gbm_bo* bo = gbm_bo_create(gbm->device(), size.width(), size.height(),
GetGbmFormatFromBufferFormat(format), flags);
if (!bo)
- return NULL;
+ return nullptr;
- scoped_refptr<GbmBuffer> buffer(new GbmBuffer(gbm, bo, scanout));
- if (scanout && !buffer->GetFramebufferId())
- return NULL;
+ scoped_refptr<GbmBuffer> buffer(new GbmBuffer(gbm, bo));
+ if (!buffer->GetFramebufferId())
+ return nullptr;
return buffer;
}

Powered by Google App Engine
This is Rietveld 408576698