Chromium Code Reviews| 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..f972cb5f3a3c5ba529b948b55aa7d5df1ec4c01b |
| --- /dev/null |
| +++ b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h |
| @@ -0,0 +1,45 @@ |
| +// 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/buffer_types.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: |
| + ClientNativePixmapVgem(const gfx::NativePixmapHandle& handle, |
| + const base::FileDescriptor& vgem_handle, |
| + const gfx::Size& size, |
| + gfx::BufferFormat format); |
| + ~ClientNativePixmapVgem() override; |
| + |
| + bool Initialize(); |
| + |
| + // ClientNativePixmap: |
|
reveman
2015/08/06 12:08:35
Overridden from Cli...
dshwang
2015/08/06 13:59:17
Done.
|
| + bool Map(void** data) override; |
| + void Unmap() override; |
| + void GetStride(int* stride) const override; |
| + |
| + private: |
| + uint32_t vgem_bo_handle_; |
| + base::ScopedFD dma_buf_; |
| + base::FileDescriptor vgem_fd_; |
| + gfx::Size size_; |
| + gfx::BufferFormat format_; |
| + int stride_; |
| + void* mmap_ptr_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ |