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

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: rebase 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
« no previous file with comments | « ui/ozone/platform/dri/gbm_surface_factory.h ('k') | ui/ozone/public/surface_factory_ozone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8d81c257e7219b5bb4d9ced23d8a4d81b42bbea7..1d74eece0a732f675edd5a2118c5d7cb295f8103 100644
--- a/ui/ozone/platform/dri/gbm_surface_factory.cc
+++ b/ui/ozone/platform/dri/gbm_surface_factory.cc
@@ -169,9 +169,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;
@@ -219,6 +223,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)) {
« no previous file with comments | « ui/ozone/platform/dri/gbm_surface_factory.h ('k') | ui/ozone/public/surface_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698