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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/buffer_types.h" | 10 #include "ui/gfx/buffer_types.h" |
11 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
12 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h" | 12 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h" |
13 #include "ui/ozone/platform/drm/gpu/screen_manager.h" | 13 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
14 #include "ui/ozone/public/native_pixmap.h" | 14 #include "ui/ozone/public/native_pixmap.h" |
15 | 15 |
16 struct gbm_bo; | 16 struct gbm_bo; |
17 | 17 |
| 18 namespace gfx { |
| 19 class NativePixmapHandle; |
| 20 } |
| 21 |
18 namespace ui { | 22 namespace ui { |
19 | 23 |
20 class GbmDevice; | 24 class GbmDevice; |
21 | 25 |
22 class GbmBuffer : public GbmBufferBase { | 26 class GbmBuffer : public GbmBufferBase { |
23 public: | 27 public: |
24 static scoped_refptr<GbmBuffer> CreateBuffer( | 28 static scoped_refptr<GbmBuffer> CreateBuffer( |
25 const scoped_refptr<GbmDevice>& gbm, | 29 const scoped_refptr<GbmDevice>& gbm, |
26 gfx::BufferFormat format, | 30 gfx::BufferFormat format, |
27 const gfx::Size& size, | 31 const gfx::Size& size, |
(...skipping 16 matching lines...) Expand all Loading... |
44 | 48 |
45 // NativePixmap: | 49 // NativePixmap: |
46 void* GetEGLClientBuffer() override; | 50 void* GetEGLClientBuffer() override; |
47 int GetDmaBufFd() override; | 51 int GetDmaBufFd() override; |
48 int GetDmaBufPitch() override; | 52 int GetDmaBufPitch() override; |
49 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 53 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
50 int plane_z_order, | 54 int plane_z_order, |
51 gfx::OverlayTransform plane_transform, | 55 gfx::OverlayTransform plane_transform, |
52 const gfx::Rect& display_bounds, | 56 const gfx::Rect& display_bounds, |
53 const gfx::RectF& crop_rect) override; | 57 const gfx::RectF& crop_rect) override; |
| 58 gfx::NativePixmapHandle ExportHandle() override; |
54 | 59 |
55 scoped_refptr<GbmBuffer> buffer() { return buffer_; } | 60 scoped_refptr<GbmBuffer> buffer() { return buffer_; } |
56 | 61 |
57 private: | 62 private: |
58 ~GbmPixmap() override; | 63 ~GbmPixmap() override; |
59 bool ShouldApplyScaling(const gfx::Rect& display_bounds, | 64 bool ShouldApplyScaling(const gfx::Rect& display_bounds, |
60 const gfx::RectF& crop_rect, | 65 const gfx::RectF& crop_rect, |
61 gfx::Size* required_size); | 66 gfx::Size* required_size); |
62 | 67 |
63 scoped_refptr<GbmBuffer> buffer_; | 68 scoped_refptr<GbmBuffer> buffer_; |
64 int dma_buf_ = -1; | 69 int dma_buf_ = -1; |
65 | 70 |
66 ScreenManager* screen_manager_; // Not owned. | 71 ScreenManager* screen_manager_; // Not owned. |
67 | 72 |
68 ScalingCallback scaling_callback_; | 73 ScalingCallback scaling_callback_; |
69 | 74 |
70 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); | 75 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); |
71 }; | 76 }; |
72 | 77 |
73 } // namespace ui | 78 } // namespace ui |
74 | 79 |
75 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ | 80 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ |
OLD | NEW |