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_OVERLAY_PLANE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_OVERLAY_PLANE_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_OVERLAY_PLANE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_OVERLAY_PLANE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
13 #include "ui/gfx/overlay_transform.h" | 14 #include "ui/gfx/overlay_transform.h" |
14 #include "ui/ozone/ozone_export.h" | 15 #include "ui/ozone/ozone_export.h" |
15 | 16 |
16 namespace ui { | 17 namespace ui { |
17 | 18 |
18 class ScanoutBuffer; | 19 class ScanoutBuffer; |
19 | 20 |
20 struct OverlayPlane; | 21 struct OverlayPlane; |
21 typedef std::vector<OverlayPlane> OverlayPlaneList; | 22 typedef std::vector<OverlayPlane> OverlayPlaneList; |
22 | 23 |
23 struct OZONE_EXPORT OverlayPlane { | 24 struct OZONE_EXPORT OverlayPlane { |
24 // Simpler constructor for the primary plane. | 25 // Simpler constructor for the primary plane. |
25 explicit OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer); | 26 explicit OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer); |
26 | 27 |
27 OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, | 28 OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, |
28 int z_order, | 29 int z_order, |
29 gfx::OverlayTransform plane_transform, | 30 gfx::OverlayTransform plane_transform, |
30 const gfx::Rect& display_bounds, | 31 const gfx::Rect& display_bounds, |
31 const gfx::RectF& crop_rect); | 32 const gfx::RectF& crop_rect); |
32 | 33 |
| 34 // This represents a callback function which can copy |source_buffer| to |
| 35 // |target_buffer| and while doing so handle any post-processing operations |
| 36 // like scaling and color space conversion. |
| 37 typedef base::Callback<bool(const scoped_refptr<ScanoutBuffer>& source_buffer, |
| 38 scoped_refptr<ScanoutBuffer>& target_buffer)> |
| 39 CopyBufferCallback; |
| 40 OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, |
| 41 int z_order, |
| 42 gfx::OverlayTransform plane_transform, |
| 43 const gfx::Rect& display_bounds, |
| 44 const gfx::RectF& crop_rect, |
| 45 const CopyBufferCallback& processing_callback); |
| 46 |
33 bool operator<(const OverlayPlane& plane) const; | 47 bool operator<(const OverlayPlane& plane) const; |
34 | 48 |
35 ~OverlayPlane(); | 49 ~OverlayPlane(); |
36 | 50 |
37 // Returns the primary plane in |overlays|. | 51 // Returns the primary plane in |overlays|. |
38 static const OverlayPlane* GetPrimaryPlane(const OverlayPlaneList& overlays); | 52 static const OverlayPlane* GetPrimaryPlane(const OverlayPlaneList& overlays); |
39 | 53 |
40 scoped_refptr<ScanoutBuffer> buffer; | 54 scoped_refptr<ScanoutBuffer> buffer; |
41 int z_order = 0; | 55 int z_order = 0; |
42 gfx::OverlayTransform plane_transform; | 56 gfx::OverlayTransform plane_transform; |
43 gfx::Rect display_bounds; | 57 gfx::Rect display_bounds; |
44 gfx::RectF crop_rect; | 58 gfx::RectF crop_rect; |
| 59 CopyBufferCallback processing_callback; |
45 }; | 60 }; |
46 | 61 |
47 } // namespace ui | 62 } // namespace ui |
48 | 63 |
49 #endif // UI_OZONE_PLATFORM_DRM_GPU_OVERLAY_PLANE_H_ | 64 #endif // UI_OZONE_PLATFORM_DRM_GPU_OVERLAY_PLANE_H_ |
OLD | NEW |