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

Unified Diff: ui/ozone/platform/drm/gpu/vgem_pixmap.h

Issue 1582613004: Ozone support for multiprocess graphics. (Closed) Base URL: https://github.com/domokit/mojo.git@submit-1
Patch Set: Created 4 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/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/vgem_pixmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/vgem_pixmap.h
diff --git a/ui/ozone/platform/drm/gpu/vgem_pixmap.h b/ui/ozone/platform/drm/gpu/vgem_pixmap.h
new file mode 100644
index 0000000000000000000000000000000000000000..04ea41ca660e6d399ce900aa3dcf7bf88e2cbb61
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/vgem_pixmap.h
@@ -0,0 +1,79 @@
+// Copyright 2015 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.
+
+#ifndef UI_OZONE_PLATFORM_DRM_GPU_VGEM_PIXMAP_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_VGEM_PIXMAP_H_
+
+#include "base/files/scoped_file.h"
+#include "base/macros.h"
+#include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
+#include "ui/ozone/platform/drm/gpu/screen_manager.h"
+#include "ui/ozone/public/native_pixmap.h"
+
+namespace ui {
+
+class DrmDevice;
+
+// VgemPixmap is a reference to a dmabuf file descriptor.
cdotstout 2016/02/01 19:06:05 Not in love with the name I used here. How about
Forrest Reiling 2016/02/10 19:13:35 Done.
+// 'Pixmap' not 'buffer' because we have a size (width and height).
+class VgemPixmap : public ScanoutBuffer {
+ public:
+ VgemPixmap(const scoped_refptr<DrmDevice>& drm);
+ ~VgemPixmap() override;
+
+ bool Initialize(base::ScopedFD dma_buf,
+ int width,
+ int height,
+ uint32_t pitch);
+
+ // ScanoutBuffer:
+ uint32_t GetFramebufferId() const override;
+ uint32_t GetHandle() const override;
+ gfx::Size GetSize() const override;
+
+ int GetDmaBufFd() const;
+ int GetDmaBufPitch() const;
+
+ private:
+ scoped_refptr<DrmDevice> drm_;
+
+ // PRIME file descriptor.
+ base::ScopedFD dma_buf_;
+ uint32_t dma_buf_pitch_ = -1;
+
+ // Local gem handle for the file descriptior.
+ uint32_t handle_ = 0;
+
+ // Framebuffer ID for scanout.
+ uint32_t framebuffer_ = 0;
+
+ int width_ = 0;
+ int height_ = 0;
+};
+
+class VgemPixmapWrapper : public NativePixmap {
+ public:
+ VgemPixmapWrapper(ScreenManager* screen_manager,
+ const scoped_refptr<VgemPixmap>& pixmap);
+ ~VgemPixmapWrapper() override;
+
+ // NativePixmap
+ void* /* EGLClientBuffer */ GetEGLClientBuffer() override;
+ int GetDmaBufFd() override;
+ int GetDmaBufPitch() override;
+
+ bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
+ int plane_z_order,
+ gfx::OverlayTransform plane_transform,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect) override;
+
+ private:
+ scoped_refptr<VgemPixmap> pixmap_;
+ ScreenManager* screen_manager_;
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_VGEM_PIXMAP_H_
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/vgem_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698