Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
|
reveman
2017/06/05 17:44:42
Can we share this code with ozone somehow? Maybe o
Julien Isorce
2017/06/05 20:23:58
Thx for the suggestions. I just had another look a
Julien Isorce
2017/06/07 20:10:48
Done.
| |
| 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_GFX_LINUX_NATIVE_PIXMAP_DMABUF_H_ | |
| 6 #define UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/files/scoped_file.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "ui/gfx/client_native_pixmap.h" | |
| 15 #include "ui/gfx/geometry/size.h" | |
| 16 #include "ui/gfx/native_pixmap.h" | |
| 17 | |
| 18 namespace gfx { | |
| 19 | |
| 20 class GFX_EXPORT NativePixmapDmaBuf : public gfx::NativePixmap { | |
| 21 public: | |
| 22 NativePixmapDmaBuf(const gfx::Size& size, | |
| 23 gfx::BufferFormat format, | |
| 24 const gfx::NativePixmapHandle& handle); | |
| 25 | |
| 26 // NativePixmap: | |
| 27 void* GetEGLClientBuffer() const override; | |
| 28 bool AreDmaBufFdsValid() const override; | |
| 29 size_t GetDmaBufFdCount() const override; | |
| 30 int GetDmaBufFd(size_t plane) const override; | |
| 31 int GetDmaBufPitch(size_t plane) const override; | |
| 32 int GetDmaBufOffset(size_t plane) const override; | |
| 33 uint64_t GetDmaBufModifier(size_t plane) const override; | |
| 34 gfx::BufferFormat GetBufferFormat() const override; | |
| 35 gfx::Size GetBufferSize() const override; | |
| 36 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | |
| 37 int plane_z_order, | |
| 38 gfx::OverlayTransform plane_transform, | |
| 39 const gfx::Rect& display_bounds, | |
| 40 const gfx::RectF& crop_rect) override; | |
| 41 void SetProcessingCallback( | |
| 42 const ProcessingCallback& processing_callback) override; | |
| 43 gfx::NativePixmapHandle ExportHandle() override; | |
| 44 | |
| 45 private: | |
| 46 ~NativePixmapDmaBuf() override; | |
| 47 | |
| 48 gfx::Size size_; | |
| 49 gfx::BufferFormat format_; | |
| 50 std::vector<base::ScopedFD> fds_; | |
| 51 std::vector<gfx::NativePixmapPlane> planes_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(NativePixmapDmaBuf); | |
| 54 }; | |
| 55 | |
| 56 } // namespace gfx | |
| 57 | |
| 58 #endif // UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_H_ | |
| OLD | NEW |