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

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

Issue 706273002: Add ability to query and allocate zero copy buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/dri/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/dri/gbm_surface_factory.cc b/ui/ozone/platform/dri/gbm_surface_factory.cc
index bbb2c407426f4f6f935f1ac6ecd0c3a0967128ba..a19ea140f7934445914d59488514d71d98dd0809 100644
--- a/ui/ozone/platform/dri/gbm_surface_factory.cc
+++ b/ui/ozone/platform/dri/gbm_surface_factory.cc
@@ -170,9 +170,13 @@ GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget(
scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
gfx::Size size,
- BufferFormat format) {
- scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer(
- drm_, device_, format, size, true);
+ BufferFormat format,
+ BufferUsage usage) {
+ if (usage == MAP)
+ return NULL;
+
+ scoped_refptr<GbmBuffer> buffer =
+ GbmBuffer::CreateBuffer(drm_, device_, format, size, true);
if (!buffer.get())
return NULL;
@@ -220,6 +224,17 @@ bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
return allow_surfaceless_;
}
+bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) {
+ switch (usage) {
+ case MAP:
+ return false;
+ case SCANOUT:
+ return true;
+ }
+ NOTREACHED();
+ return false;
+}
+
DriWindowDelegate* GbmSurfaceFactory::GetOrCreateWindowDelegate(
gfx::AcceleratedWidget widget) {
if (!window_manager_->HasWindowDelegate(widget)) {

Powered by Google App Engine
This is Rietveld 408576698