Index: ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h |
diff --git a/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..084a6bee73db163429d0af0f0bc4db017aa90cb0 |
--- /dev/null |
+++ b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h |
@@ -0,0 +1,47 @@ |
+// 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_CLIENT_NATIVE_PIXMAP_VGEM_H_ |
+#define UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ |
+ |
+#include "base/file_descriptor_posix.h" |
+#include "ui/gfx/geometry/size.h" |
+#include "ui/gfx/native_pixmap_handle_ozone.h" |
+#include "ui/ozone/public/client_native_pixmap.h" |
+ |
+namespace ui { |
+ |
+class ClientNativePixmapVgem : public ClientNativePixmap { |
+ public: |
+ static scoped_ptr<ClientNativePixmap> Create( |
+ const gfx::NativePixmapHandle& handle, |
+ const base::FileDescriptor& vgem_handle, |
+ const gfx::Size& size); |
+ |
+ ~ClientNativePixmapVgem() override; |
+ |
+ // Overridden from ClientNativePixmap. |
+ bool Map(void** data) override; |
+ void Unmap() override; |
+ void GetStride(int* stride) const override; |
+ |
+ private: |
+ ClientNativePixmapVgem(const gfx::NativePixmapHandle& handle, |
+ const base::FileDescriptor& vgem_handle, |
+ const gfx::Size& size, |
+ uint32_t vgem_bo_handle); |
+ |
+ base::ScopedFD dma_buf_; |
+ base::FileDescriptor vgem_fd_; |
+ gfx::Size size_; |
+ uint32_t vgem_bo_handle_; |
+ int stride_; |
+ void* data_; |
reveman
2015/08/07 17:59:44
can some of these members be const?
dshwang
2015/08/11 17:44:56
good point. all except for |data_|. Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ |