Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 class GbmDevice; | 21 class GbmDevice; |
| 22 class GbmSurfaceFactory; | 22 class GbmSurfaceFactory; |
| 23 | 23 |
| 24 class GbmBuffer : public GbmBufferBase { | 24 class GbmBuffer : public GbmBufferBase { |
| 25 public: | 25 public: |
| 26 static scoped_refptr<GbmBuffer> CreateBuffer( | 26 static scoped_refptr<GbmBuffer> CreateBuffer( |
| 27 const scoped_refptr<GbmDevice>& gbm, | 27 const scoped_refptr<GbmDevice>& gbm, |
| 28 uint32_t format, | 28 uint32_t format, |
| 29 const gfx::Size& size, | 29 const gfx::Size& size, |
| 30 uint32_t usage); | 30 uint32_t usage); |
| 31 static scoped_refptr<GbmBuffer> CreateBufferWithModifiers( | |
|
Daniele Castagna
2016/12/16 00:27:41
Why do we need CreateBufferWithModifiers? Can't we
hoegsberg1
2016/12/17 01:10:49
Hm, I suppose we could just do that. It's a little
dnicoara
2016/12/19 19:44:46
Should |flags| be removed from the definition then
| |
| 32 const scoped_refptr<GbmDevice>& gbm, | |
| 33 uint32_t format, | |
| 34 const gfx::Size& size, | |
| 35 uint32_t flags, | |
| 36 const uint64_t *modifiers, uint32_t nmodifiers); | |
| 31 static scoped_refptr<GbmBuffer> CreateBufferFromFds( | 37 static scoped_refptr<GbmBuffer> CreateBufferFromFds( |
| 32 const scoped_refptr<GbmDevice>& gbm, | 38 const scoped_refptr<GbmDevice>& gbm, |
| 33 uint32_t format, | 39 uint32_t format, |
| 34 const gfx::Size& size, | 40 const gfx::Size& size, |
| 35 std::vector<base::ScopedFD>&& fds, | 41 std::vector<base::ScopedFD>&& fds, |
| 36 const std::vector<gfx::NativePixmapPlane>& planes); | 42 const std::vector<gfx::NativePixmapPlane>& planes); |
| 37 uint32_t GetFormat() const { return format_; } | 43 uint32_t GetFormat() const { return format_; } |
| 38 uint32_t GetFlags() const { return flags_; } | 44 uint32_t GetFlags() const { return flags_; } |
| 39 bool AreFdsValid() const; | 45 bool AreFdsValid() const; |
| 40 size_t GetFdCount() const; | 46 size_t GetFdCount() const; |
| 41 int GetFd(size_t plane) const; | 47 int GetFd(size_t plane) const; |
| 42 int GetStride(size_t plane) const; | 48 int GetStride(size_t plane) const; |
| 43 int GetOffset(size_t plane) const; | 49 int GetOffset(size_t plane) const; |
| 44 size_t GetSize(size_t plane) const; | 50 size_t GetSize(size_t plane) const; |
| 45 uint64_t GetFormatModifier(size_t plane) const; | 51 uint64_t GetFormatModifier(size_t plane) const; |
| 46 gfx::Size GetSize() const override; | 52 gfx::Size GetSize() const override; |
| 47 | 53 |
| 48 private: | 54 private: |
| 49 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, | 55 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, |
| 50 gbm_bo* bo, | 56 gbm_bo* bo, |
| 51 uint32_t format, | 57 uint32_t format, |
| 52 uint32_t flags, | 58 uint32_t flags, |
| 59 uint64_t modifier, | |
| 53 std::vector<base::ScopedFD>&& fds, | 60 std::vector<base::ScopedFD>&& fds, |
| 54 const gfx::Size& size, | 61 const gfx::Size& size, |
| 55 const std::vector<gfx::NativePixmapPlane>&& planes); | 62 const std::vector<gfx::NativePixmapPlane>&& planes); |
| 56 ~GbmBuffer() override; | 63 ~GbmBuffer() override; |
| 57 | 64 |
| 58 uint32_t format_; | 65 uint32_t format_; |
| 59 uint32_t flags_; | 66 uint32_t flags_; |
| 67 uint64_t modifier_; | |
| 60 std::vector<base::ScopedFD> fds_; | 68 std::vector<base::ScopedFD> fds_; |
| 61 gfx::Size size_; | 69 gfx::Size size_; |
| 62 | 70 |
| 63 std::vector<gfx::NativePixmapPlane> planes_; | 71 std::vector<gfx::NativePixmapPlane> planes_; |
| 64 | 72 |
| 65 DISALLOW_COPY_AND_ASSIGN(GbmBuffer); | 73 DISALLOW_COPY_AND_ASSIGN(GbmBuffer); |
| 66 }; | 74 }; |
| 67 | 75 |
| 68 class GbmPixmap : public NativePixmap { | 76 class GbmPixmap : public NativePixmap { |
| 69 public: | 77 public: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // this Pixmap. This holds the processed buffer. | 112 // this Pixmap. This holds the processed buffer. |
| 105 scoped_refptr<GbmPixmap> processed_pixmap_; | 113 scoped_refptr<GbmPixmap> processed_pixmap_; |
| 106 ProcessingCallback processing_callback_; | 114 ProcessingCallback processing_callback_; |
| 107 | 115 |
| 108 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); | 116 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); |
| 109 }; | 117 }; |
| 110 | 118 |
| 111 } // namespace ui | 119 } // namespace ui |
| 112 | 120 |
| 113 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 121 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
| OLD | NEW |