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

Unified Diff: ui/ozone/platform/dri/gbm_buffer.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/gbm_buffer.h ('k') | ui/ozone/platform/dri/gbm_buffer_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/gbm_buffer.cc
diff --git a/ui/ozone/platform/dri/gbm_buffer.cc b/ui/ozone/platform/dri/gbm_buffer.cc
deleted file mode 100644
index 030dc3b341b09047a2141ec250a09ee8254b0b00..0000000000000000000000000000000000000000
--- a/ui/ozone/platform/dri/gbm_buffer.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/ozone/platform/dri/gbm_buffer.h"
-
-#include <gbm.h>
-
-#include "base/logging.h"
-
-namespace ui {
-
-namespace {
-
-int GetGbmFormatFromBufferFormat(SurfaceFactoryOzone::BufferFormat fmt) {
- switch (fmt) {
- case SurfaceFactoryOzone::RGBA_8888:
- return GBM_BO_FORMAT_ARGB8888;
- case SurfaceFactoryOzone::RGBX_8888:
- return GBM_BO_FORMAT_XRGB8888;
- default:
- NOTREACHED();
- return 0;
- }
-}
-
-} // namespace
-
-GbmBuffer::GbmBuffer(DriWrapper* dri, gbm_bo* bo, bool scanout)
- : GbmBufferBase(dri, bo, scanout) {
-}
-
-GbmBuffer::~GbmBuffer() {
- if (bo())
- gbm_bo_destroy(bo());
-}
-
-// static
-scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer(
- DriWrapper* dri,
- gbm_device* device,
- SurfaceFactoryOzone::BufferFormat format,
- const gfx::Size& size,
- bool scanout) {
- unsigned flags = GBM_BO_USE_RENDERING;
- if (scanout)
- flags |= GBM_BO_USE_SCANOUT;
- gbm_bo* bo = gbm_bo_create(device,
- size.width(),
- size.height(),
- GetGbmFormatFromBufferFormat(format),
- flags);
- if (!bo)
- return NULL;
-
- scoped_refptr<GbmBuffer> buffer(new GbmBuffer(dri, bo, scanout));
- if (scanout && !buffer->GetFramebufferId())
- return NULL;
-
- return buffer;
-}
-
-GbmPixmap::GbmPixmap(scoped_refptr<GbmBuffer> buffer) : buffer_(buffer) {
-}
-
-GbmPixmap::~GbmPixmap() {
-}
-
-void* GbmPixmap::GetEGLClientBuffer() {
- return buffer_->bo();
-}
-
-int GbmPixmap::GetDmaBufFd() {
- return -1;
-}
-
-int GbmPixmap::GetDmaBufPitch() {
- return -1;
-}
-
-} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/gbm_buffer.h ('k') | ui/ozone/platform/dri/gbm_buffer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698