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..aeb40315c16cd3a1fef367a87ac5fc9a999ca835 |
--- /dev/null |
+++ b/ui/ozone/platform/drm/gpu/vgem_pixmap.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 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_BUFFER_H_ |
+#define UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_ |
+ |
+#include "ui/ozone/public/native_pixmap.h" |
+#include "ui/ozone/public/surface_factory_ozone.h" |
+ |
+namespace ui { |
+ |
+class VgemPixmap : public NativePixmap { |
+ public: |
+ VgemPixmap(base::FileDescriptor handle, |
+ base::FileDescriptor vgem_handle, |
+ gfx::Size size, |
+ SurfaceFactoryOzone::BufferFormat format, |
+ BufferUsage usage); |
+ bool Initialize(); |
+ |
+ // NativePixmap: |
+ void* GetEGLClientBuffer() override; |
+ int GetDmaBufFd() override; |
+ int GetDmaBufPitch() override; |
+ BufferUsage GetBufferUsage() const override; |
+ void* Map() override; |
+ void Unmap() override; |
+ |
+ protected: |
+ ~VgemPixmap() override; |
+ |
+ private: |
+ uint32_t vgem_bo_handle_; |
+ base::ScopedFD dma_buf_; |
+ base::FileDescriptor vgem_fd_; |
+ gfx::Size size_; |
+ SurfaceFactoryOzone::BufferFormat format_; |
+ BufferUsage usage_; |
+ size_t stride_; |
+ void* mmap_ptr_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VgemPixmap); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_ |