OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_VGEM_BUFFER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_ |
| 7 |
| 8 #include "ui/ozone/public/native_pixmap.h" |
| 9 #include "ui/ozone/public/surface_factory_ozone.h" |
| 10 |
| 11 namespace ui { |
| 12 |
| 13 class VgemPixmap : public NativePixmap { |
| 14 public: |
| 15 VgemPixmap(base::FileDescriptor handle, |
| 16 base::FileDescriptor vgem_handle, |
| 17 gfx::Size size, |
| 18 SurfaceFactoryOzone::BufferFormat format, |
| 19 BufferUsage usage); |
| 20 bool Initialize(); |
| 21 |
| 22 // NativePixmap: |
| 23 void* GetEGLClientBuffer() override; |
| 24 int GetDmaBufFd() override; |
| 25 int GetDmaBufPitch() override; |
| 26 BufferUsage GetBufferUsage() const override; |
| 27 void* Map() override; |
| 28 void Unmap() override; |
| 29 |
| 30 protected: |
| 31 ~VgemPixmap() override; |
| 32 |
| 33 private: |
| 34 uint32_t vgem_bo_handle_; |
| 35 base::ScopedFD dma_buf_; |
| 36 base::FileDescriptor vgem_fd_; |
| 37 gfx::Size size_; |
| 38 SurfaceFactoryOzone::BufferFormat format_; |
| 39 BufferUsage usage_; |
| 40 size_t stride_; |
| 41 void* mmap_ptr_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(VgemPixmap); |
| 44 }; |
| 45 |
| 46 } // namespace ui |
| 47 |
| 48 #endif // UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_ |
OLD | NEW |