| 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_SCANOUT_BUFFER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "ui/gfx/buffer_types.h" | 11 #include "ui/gfx/buffer_types.h" |
| 12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 class DrmDevice; | 16 class DrmDevice; |
| 17 | 17 |
| 18 // Abstraction for a DRM buffer that can be scanned-out of. | 18 // Abstraction for a DRM buffer that can be scanned-out of. |
| 19 class ScanoutBuffer : public base::RefCountedThreadSafe<ScanoutBuffer> { | 19 class ScanoutBuffer : public base::RefCountedThreadSafe<ScanoutBuffer> { |
| 20 public: | 20 public: |
| 21 // ID allocated by the KMS API when the buffer is registered (via the handle). | 21 // ID allocated by the KMS API when the buffer is registered (via the handle). |
| 22 virtual uint32_t GetFramebufferId() const = 0; | 22 virtual uint32_t GetFramebufferId() const = 0; |
| 23 | 23 |
| 24 // ID allocated if the buffer is also registered with a different pixel format |
| 25 // so that it can be scheduled as an opaque buffer. |
| 26 virtual uint32_t GetOpaqueFramebufferId() const = 0; |
| 27 |
| 24 // Returns FourCC format representing the way pixel data has been encoded in | 28 // Returns FourCC format representing the way pixel data has been encoded in |
| 25 // memory for the registered framebuffer. This can be used to check if frame | 29 // memory for the registered framebuffer. This can be used to check if frame |
| 26 // buffer is compatible with a given hardware plane. | 30 // buffer is compatible with a given hardware plane. |
| 27 virtual uint32_t GetFramebufferPixelFormat() const = 0; | 31 virtual uint32_t GetFramebufferPixelFormat() const = 0; |
| 28 | 32 |
| 33 // Returns FourCC format that should be used to schedule this buffer for |
| 34 // scanout when used as an opaque buffer. |
| 35 virtual uint32_t GetOpaqueFramebufferPixelFormat() const = 0; |
| 36 |
| 29 // Handle for the buffer. This is received when allocating the buffer. | 37 // Handle for the buffer. This is received when allocating the buffer. |
| 30 virtual uint32_t GetHandle() const = 0; | 38 virtual uint32_t GetHandle() const = 0; |
| 31 | 39 |
| 32 // Size of the buffer. | 40 // Size of the buffer. |
| 33 virtual gfx::Size GetSize() const = 0; | 41 virtual gfx::Size GetSize() const = 0; |
| 34 | 42 |
| 35 // Device on which the buffer was created. | 43 // Device on which the buffer was created. |
| 36 virtual const DrmDevice* GetDrmDevice() const = 0; | 44 virtual const DrmDevice* GetDrmDevice() const = 0; |
| 37 | 45 |
| 38 virtual bool RequiresGlFinish() const = 0; | 46 virtual bool RequiresGlFinish() const = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 | 57 |
| 50 virtual scoped_refptr<ScanoutBuffer> Create( | 58 virtual scoped_refptr<ScanoutBuffer> Create( |
| 51 const scoped_refptr<DrmDevice>& drm, | 59 const scoped_refptr<DrmDevice>& drm, |
| 52 uint32_t format, | 60 uint32_t format, |
| 53 const gfx::Size& size) = 0; | 61 const gfx::Size& size) = 0; |
| 54 }; | 62 }; |
| 55 | 63 |
| 56 } // namespace ui | 64 } // namespace ui |
| 57 | 65 |
| 58 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_ | 66 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_ |
| OLD | NEW |