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 21 matching lines...) Expand all Loading... | |
| 32 const scoped_refptr<GbmDevice>& gbm, | 32 const scoped_refptr<GbmDevice>& gbm, |
| 33 gfx::BufferFormat format, | 33 gfx::BufferFormat format, |
| 34 const gfx::Size& size, | 34 const gfx::Size& size, |
| 35 std::vector<base::ScopedFD>&& fds, | 35 std::vector<base::ScopedFD>&& fds, |
| 36 const std::vector<int>& strides); | 36 const std::vector<int>& strides); |
| 37 gfx::BufferFormat GetFormat() const { return format_; } | 37 gfx::BufferFormat GetFormat() const { return format_; } |
| 38 gfx::BufferUsage GetUsage() const { return usage_; } | 38 gfx::BufferUsage GetUsage() const { return usage_; } |
| 39 bool AreFdsValid() const; | 39 bool AreFdsValid() const; |
| 40 int GetFd(size_t plane) const; | 40 int GetFd(size_t plane) const; |
| 41 int GetStride(size_t plane) const; | 41 int GetStride(size_t plane) const; |
| 42 uint64_t GetFormatModifier(size_t plane) const; | |
| 42 gfx::Size GetSize() const override; | 43 gfx::Size GetSize() const override; |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, | 46 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, |
| 46 gbm_bo* bo, | 47 gbm_bo* bo, |
| 47 gfx::BufferFormat format, | 48 gfx::BufferFormat format, |
| 48 gfx::BufferUsage usage, | 49 gfx::BufferUsage usage, |
| 49 std::vector<base::ScopedFD>&& fds, | 50 std::vector<base::ScopedFD>&& fds, |
| 50 const gfx::Size& size, | 51 const gfx::Size& size, |
| 51 const std::vector<int>& strides); | 52 const std::vector<int>& strides, |
| 53 const std::vector<uint64_t>& modifiers); | |
|
marcheu1
2016/06/07 01:29:07
Is there a way we can have multiple modifiers? I d
vinceh
2016/06/07 01:56:30
Since the patch "Add support for multiple FDs to N
| |
| 52 ~GbmBuffer() override; | 54 ~GbmBuffer() override; |
| 53 | 55 |
| 54 gfx::BufferFormat format_; | 56 gfx::BufferFormat format_; |
| 55 gfx::BufferUsage usage_; | 57 gfx::BufferUsage usage_; |
| 56 std::vector<base::ScopedFD> fds_; | 58 std::vector<base::ScopedFD> fds_; |
| 57 gfx::Size size_; | 59 gfx::Size size_; |
| 58 std::vector<int> strides_; | 60 std::vector<int> strides_; |
| 61 std::vector<uint64_t> modifiers_; | |
| 59 | 62 |
| 60 DISALLOW_COPY_AND_ASSIGN(GbmBuffer); | 63 DISALLOW_COPY_AND_ASSIGN(GbmBuffer); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 class GbmPixmap : public NativePixmap { | 66 class GbmPixmap : public NativePixmap { |
| 64 public: | 67 public: |
| 65 GbmPixmap(GbmSurfaceFactory* surface_manager, | 68 GbmPixmap(GbmSurfaceFactory* surface_manager, |
| 66 const scoped_refptr<GbmBuffer>& buffer); | 69 const scoped_refptr<GbmBuffer>& buffer); |
| 67 | 70 |
| 68 void SetProcessingCallback( | 71 void SetProcessingCallback( |
| 69 const ProcessingCallback& processing_callback) override; | 72 const ProcessingCallback& processing_callback) override; |
| 70 | 73 |
| 71 // NativePixmap: | 74 // NativePixmap: |
| 72 void* GetEGLClientBuffer() const override; | 75 void* GetEGLClientBuffer() const override; |
| 73 bool AreDmaBufFdsValid() const override; | 76 bool AreDmaBufFdsValid() const override; |
| 74 int GetDmaBufFd(size_t plane) const override; | 77 int GetDmaBufFd(size_t plane) const override; |
| 75 int GetDmaBufPitch(size_t plane) const override; | 78 int GetDmaBufPitch(size_t plane) const override; |
| 79 uint64_t GetDmaBufModifier(size_t plane) const override; | |
| 76 gfx::BufferFormat GetBufferFormat() const override; | 80 gfx::BufferFormat GetBufferFormat() const override; |
| 77 gfx::Size GetBufferSize() const override; | 81 gfx::Size GetBufferSize() const override; |
| 78 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 82 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 79 int plane_z_order, | 83 int plane_z_order, |
| 80 gfx::OverlayTransform plane_transform, | 84 gfx::OverlayTransform plane_transform, |
| 81 const gfx::Rect& display_bounds, | 85 const gfx::Rect& display_bounds, |
| 82 const gfx::RectF& crop_rect) override; | 86 const gfx::RectF& crop_rect) override; |
| 83 gfx::NativePixmapHandle ExportHandle() override; | 87 gfx::NativePixmapHandle ExportHandle() override; |
| 84 | 88 |
| 85 scoped_refptr<GbmBuffer> buffer() { return buffer_; } | 89 scoped_refptr<GbmBuffer> buffer() { return buffer_; } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 96 // this Pixmap. This holds the processed buffer. | 100 // this Pixmap. This holds the processed buffer. |
| 97 scoped_refptr<GbmPixmap> processed_pixmap_; | 101 scoped_refptr<GbmPixmap> processed_pixmap_; |
| 98 ProcessingCallback processing_callback_; | 102 ProcessingCallback processing_callback_; |
| 99 | 103 |
| 100 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); | 104 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace ui | 107 } // namespace ui |
| 104 | 108 |
| 105 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 109 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
| OLD | NEW |