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_COMMON_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
6 #define UI_OZONE_PLATFORM_DRM_COMMON_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/file_descriptor_posix.h" | |
11 #include "base/macros.h" | |
12 #include "ui/gfx/geometry/size.h" | |
13 #include "ui/gfx/native_pixmap_handle_ozone.h" | |
14 #include "ui/ozone/public/client_native_pixmap.h" | |
15 | |
16 namespace ui { | |
17 | |
18 class ClientNativePixmapVgem : public ClientNativePixmap { | |
19 public: | |
20 static scoped_ptr<ClientNativePixmap> ImportFromDmabuf(int vgem_fd, | |
21 int dmabuf_fd, | |
22 const gfx::Size& size, | |
23 int stride); | |
24 | |
25 ~ClientNativePixmapVgem() override; | |
26 | |
27 // Overridden from ClientNativePixmap. | |
28 void* Map() override; | |
29 void Unmap() override; | |
30 void GetStride(int* stride) const override; | |
31 | |
32 private: | |
33 ClientNativePixmapVgem(int vgem_fd, | |
34 uint32_t vgem_bo_handle, | |
35 const gfx::Size& size, | |
36 int stride); | |
37 | |
38 const int vgem_fd_; | |
39 const uint32_t vgem_bo_handle_; | |
40 const gfx::Size size_; | |
41 const int stride_; | |
42 void* data_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem); | |
45 }; | |
46 | |
47 } // namespace ui | |
48 | |
49 #endif // UI_OZONE_PLATFORM_DRM_COMMON_CLIENT_NATIVE_PIXMAP_VGEM_H_ | |
OLD | NEW |