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

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

Issue 1582613004: Ozone support for multiprocess graphics. (Closed) Base URL: https://github.com/domokit/mojo.git@submit-1
Patch Set: rebase Created 4 years, 10 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 93e7793a00739c955230265bc6dafaf3db652fa6..80a9b1fa765396ef8a9fce83eaecc42658de270c 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -10,6 +10,7 @@
#include "third_party/khronos/EGL/egl.h"
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
+#include "ui/ozone/platform/drm/gpu/drm_dmabuf_pixmap.h"
#include "ui/ozone/platform/drm/gpu/drm_window.h"
#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
#include "ui/ozone/platform/drm/gpu/gbm_device.h"
@@ -130,6 +131,22 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
return pixmap;
}
+scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle(
+ gfx::AcceleratedWidget widget,
+ gfx::Size size,
+ const gfx::NativePixmapHandle& handle) {
+ scoped_refptr<DrmDevice> drm =
+ drm_device_manager_->GetDrmDevice(widget).get();
+ DCHECK(drm);
+
+ scoped_refptr<VgemPixmap> pixmap(new VgemPixmap(drm));
+ pixmap->Initialize(base::ScopedFD(handle.fd.fd), size.width(), size.height(),
+ handle.stride);
+
+ return scoped_refptr<VgemPixmapWrapper>(
+ new VgemPixmapWrapper(screen_manager_, pixmap));
+}
+
bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
DCHECK(thread_checker_.CalledOnValidThread());
return allow_surfaceless_;
« 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