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..6d5da01a6d0359c32409ced6328cbb954d0d0886 |
--- /dev/null |
+++ b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h |
@@ -0,0 +1,46 @@ |
+// 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, |
spang
2015/08/12 21:40:03
Could you unpack "handle" at the same place owners
dshwang
2015/08/13 11:30:56
Done.
|
+ const base::FileDescriptor& vgem_handle, |
spang
2015/08/12 21:40:03
I'd prefer
int vgem_fd
over
const base::FileDe
dshwang
2015/08/13 11:30:56
Done.
|
+ 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 base::FileDescriptor& vgem_handle, |
+ uint32_t vgem_bo_handle, |
+ const gfx::Size& size, |
+ int stride); |
+ |
+ const base::FileDescriptor vgem_fd_; |
spang
2015/08/12 21:40:03
Same here. Wrapping the fd inside base::FileDescri
dshwang
2015/08/13 11:30:56
Done.
|
+ const uint32_t vgem_bo_handle_; |
+ const gfx::Size size_; |
+ const int stride_; |
+ void* data_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ |