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

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

Issue 1381133002: ozone: Implement support for CreateGpuMemoryBufferFromHandle for OzoneNativePixmap backed GMBs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-factory-create-from-handle
Patch Set: rebase Created 5 years, 2 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/drm/gpu/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/drm/gpu/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
index 060f7be7a90044edaf2b249d583bcdef49796f1b..32bb918fc25f1590130372a217a86075b3c510ba 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -128,13 +128,20 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
if (!buffer.get())
return nullptr;
- scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer, this));
- if (!pixmap->Initialize())
+ scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this));
+ if (!pixmap->InitializeFromBuffer(buffer))
return nullptr;
return pixmap;
}
+scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle(
+ const gfx::NativePixmapHandle& handle) {
+ scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this));
+ pixmap->Initialize(base::ScopedFD(handle.fd.fd), handle.stride);
+ return pixmap;
+}
+
scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
gfx::AcceleratedWidget widget) {
return static_cast<GbmDevice*>(
« no previous file with comments | « ui/ozone/platform/drm/gpu/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