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_DRI_GBM_SURFACE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ |
6 #define UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ | 6 #define UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | |
10 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
11 #include "ui/ozone/platform/dri/gbm_surfaceless.h" | 10 #include "ui/ozone/platform/dri/gbm_surfaceless.h" |
12 #include "ui/ozone/public/surface_ozone_egl.h" | 11 #include "ui/ozone/public/surface_ozone_egl.h" |
13 | 12 |
14 struct gbm_bo; | 13 struct gbm_bo; |
15 struct gbm_device; | 14 struct gbm_device; |
16 struct gbm_surface; | 15 struct gbm_surface; |
17 | 16 |
18 namespace ui { | 17 namespace ui { |
19 | 18 |
20 class DriBuffer; | 19 class DriBuffer; |
21 class DriWrapper; | 20 class DriWrapper; |
| 21 class DriWindowDelegate; |
22 | 22 |
23 // Extends the GBM surfaceless functionality and adds an implicit surface for | 23 // Extends the GBM surfaceless functionality and adds an implicit surface for |
24 // the primary plane. Arbitrary buffers can still be allocated and displayed as | 24 // the primary plane. Arbitrary buffers can still be allocated and displayed as |
25 // overlay planes, however the primary plane is associated with the native | 25 // overlay planes, however the primary plane is associated with the native |
26 // surface and is updated via an EGLSurface. | 26 // surface and is updated via an EGLSurface. |
27 class GbmSurface : public GbmSurfaceless { | 27 class GbmSurface : public GbmSurfaceless { |
28 public: | 28 public: |
29 GbmSurface(const base::WeakPtr<HardwareDisplayController>& controller, | 29 GbmSurface(DriWindowDelegate* window_delegate, |
30 gbm_device* device, | 30 gbm_device* device, |
31 DriWrapper* dri); | 31 DriWrapper* dri); |
32 virtual ~GbmSurface(); | 32 virtual ~GbmSurface(); |
33 | 33 |
34 bool Initialize(); | 34 bool Initialize(); |
35 | 35 |
36 // GbmSurfaceless: | 36 // GbmSurfaceless: |
37 virtual intptr_t GetNativeWindow() OVERRIDE; | 37 virtual intptr_t GetNativeWindow() OVERRIDE; |
38 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE; | 38 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE; |
39 virtual bool OnSwapBuffers() OVERRIDE; | 39 virtual bool OnSwapBuffers() OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
50 gbm_bo* current_buffer_; | 50 gbm_bo* current_buffer_; |
51 | 51 |
52 gfx::Size size_; | 52 gfx::Size size_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(GbmSurface); | 54 DISALLOW_COPY_AND_ASSIGN(GbmSurface); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace ui | 57 } // namespace ui |
58 | 58 |
59 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ | 59 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ |
OLD | NEW |