| 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 20 matching lines...) Expand all Loading... |
| 31 static scoped_refptr<GbmBuffer> CreateBufferFromFds( | 31 static scoped_refptr<GbmBuffer> CreateBufferFromFds( |
| 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 const std::vector<int>& offsets); | 37 const std::vector<int>& offsets); |
| 38 gfx::BufferFormat GetFormat() const { return format_; } | 38 gfx::BufferFormat GetFormat() const { return format_; } |
| 39 gfx::BufferUsage GetUsage() const { return usage_; } | 39 gfx::BufferUsage GetUsage() const { return usage_; } |
| 40 bool AreFdsValid() const; | 40 bool AreFdsValid() const; |
| 41 size_t GetFdCount() const; |
| 41 int GetFd(size_t plane) const; | 42 int GetFd(size_t plane) const; |
| 42 int GetStride(size_t plane) const; | 43 int GetStride(size_t plane) const; |
| 43 int GetOffset(size_t plane) const; | 44 int GetOffset(size_t plane) const; |
| 44 gfx::Size GetSize() const override; | 45 gfx::Size GetSize() const override; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, | 48 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, |
| 48 gbm_bo* bo, | 49 gbm_bo* bo, |
| 49 gfx::BufferFormat format, | 50 gfx::BufferFormat format, |
| 50 gfx::BufferUsage usage, | 51 gfx::BufferUsage usage, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 public: | 69 public: |
| 69 GbmPixmap(GbmSurfaceFactory* surface_manager, | 70 GbmPixmap(GbmSurfaceFactory* surface_manager, |
| 70 const scoped_refptr<GbmBuffer>& buffer); | 71 const scoped_refptr<GbmBuffer>& buffer); |
| 71 | 72 |
| 72 void SetProcessingCallback( | 73 void SetProcessingCallback( |
| 73 const ProcessingCallback& processing_callback) override; | 74 const ProcessingCallback& processing_callback) override; |
| 74 | 75 |
| 75 // NativePixmap: | 76 // NativePixmap: |
| 76 void* GetEGLClientBuffer() const override; | 77 void* GetEGLClientBuffer() const override; |
| 77 bool AreDmaBufFdsValid() const override; | 78 bool AreDmaBufFdsValid() const override; |
| 79 size_t GetDmaBufFdCount() const override; |
| 78 int GetDmaBufFd(size_t plane) const override; | 80 int GetDmaBufFd(size_t plane) const override; |
| 79 int GetDmaBufPitch(size_t plane) const override; | 81 int GetDmaBufPitch(size_t plane) const override; |
| 80 int GetDmaBufOffset(size_t plane) const override; | 82 int GetDmaBufOffset(size_t plane) const override; |
| 81 gfx::BufferFormat GetBufferFormat() const override; | 83 gfx::BufferFormat GetBufferFormat() const override; |
| 82 gfx::Size GetBufferSize() const override; | 84 gfx::Size GetBufferSize() const override; |
| 83 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 85 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 84 int plane_z_order, | 86 int plane_z_order, |
| 85 gfx::OverlayTransform plane_transform, | 87 gfx::OverlayTransform plane_transform, |
| 86 const gfx::Rect& display_bounds, | 88 const gfx::Rect& display_bounds, |
| 87 const gfx::RectF& crop_rect) override; | 89 const gfx::RectF& crop_rect) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 101 // this Pixmap. This holds the processed buffer. | 103 // this Pixmap. This holds the processed buffer. |
| 102 scoped_refptr<GbmPixmap> processed_pixmap_; | 104 scoped_refptr<GbmPixmap> processed_pixmap_; |
| 103 ProcessingCallback processing_callback_; | 105 ProcessingCallback processing_callback_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); | 107 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 } // namespace ui | 110 } // namespace ui |
| 109 | 111 |
| 110 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 112 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
| OLD | NEW |