Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
| 7 | |
| 8 #include "base/file_descriptor_posix.h" | |
| 9 #include "ui/gfx/buffer_types.h" | |
| 10 #include "ui/gfx/geometry/size.h" | |
| 11 #include "ui/gfx/native_pixmap_handle_ozone.h" | |
| 12 #include "ui/ozone/public/client_native_pixmap.h" | |
| 13 | |
| 14 namespace ui { | |
| 15 | |
| 16 class ClientNativePixmapVgem : public ClientNativePixmap { | |
| 17 public: | |
| 18 static scoped_ptr<ClientNativePixmap> Create( | |
| 19 const gfx::NativePixmapHandle& handle, | |
| 20 const base::FileDescriptor& vgem_handle, | |
| 21 const gfx::Size& size, | |
| 22 gfx::BufferFormat format, | |
| 23 gfx::BufferUsage usage); | |
| 24 | |
| 25 ~ClientNativePixmapVgem() override; | |
| 26 | |
| 27 // Overridden from ClientNativePixmap. | |
| 28 bool Map(void** data) override; | |
| 29 void Unmap() override; | |
| 30 void GetStride(int* stride) const override; | |
| 31 | |
| 32 private: | |
| 33 ClientNativePixmapVgem(const gfx::NativePixmapHandle& handle, | |
| 34 const base::FileDescriptor& vgem_handle, | |
| 35 const gfx::Size& size, | |
| 36 gfx::BufferFormat format, | |
| 37 gfx::BufferUsage usage, | |
| 38 uint32_t vgem_bo_handle); | |
| 39 | |
| 40 base::ScopedFD dma_buf_; | |
|
reveman
2015/08/07 14:35:16
what is this used for?
dshwang
2015/08/07 15:36:46
Client should keep dmabuf fd and close it after vg
reveman
2015/08/07 17:59:44
drmPrimeFDToHandle doesn't dup the fd? That's a bi
dshwang
2015/08/11 17:44:56
you are right. Don't need to keep dmabuf fd. remov
| |
| 41 base::FileDescriptor vgem_fd_; | |
| 42 gfx::Size size_; | |
| 43 gfx::BufferFormat format_; | |
|
reveman
2015/08/07 14:35:16
where is this used?
dshwang
2015/08/07 15:36:46
Removed.
| |
| 44 gfx::BufferUsage usage_; | |
|
reveman
2015/08/07 14:35:16
what do we need this for?
dshwang
2015/08/07 15:36:46
Removed.
| |
| 45 uint32_t vgem_bo_handle_; | |
| 46 int stride_; | |
| 47 void* mmap_ptr_; | |
|
reveman
2015/08/07 14:35:16
s/mmap_ptr_/data_/ ?
dshwang
2015/08/07 15:36:46
Done.
| |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem); | |
| 50 }; | |
| 51 | |
| 52 } // namespace ui | |
| 53 | |
| 54 #endif // UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
| OLD | NEW |