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/weak_ptr.h" |
9 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
10 #include "ui/ozone/platform/dri/gbm_surfaceless.h" | 11 #include "ui/ozone/platform/dri/gbm_surfaceless.h" |
11 #include "ui/ozone/public/surface_ozone_egl.h" | 12 #include "ui/ozone/public/surface_ozone_egl.h" |
12 | 13 |
13 struct gbm_bo; | 14 struct gbm_bo; |
14 struct gbm_device; | 15 struct gbm_device; |
15 struct gbm_surface; | 16 struct gbm_surface; |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 | 19 |
(...skipping 14 matching lines...) Expand all Loading... |
33 | 34 |
34 bool Initialize(); | 35 bool Initialize(); |
35 | 36 |
36 // GbmSurfaceless: | 37 // GbmSurfaceless: |
37 intptr_t GetNativeWindow() override; | 38 intptr_t GetNativeWindow() override; |
38 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; | 39 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; |
39 bool OnSwapBuffers() override; | 40 bool OnSwapBuffers() override; |
40 bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; | 41 bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; |
41 | 42 |
42 private: | 43 private: |
| 44 void OnSwapBuffersCallback(const SwapCompletionCallback& callback, |
| 45 gbm_bo* pending_buffer); |
| 46 |
43 gbm_device* gbm_device_; | 47 gbm_device* gbm_device_; |
44 | 48 |
45 DriWrapper* dri_; | 49 DriWrapper* dri_; |
46 | 50 |
47 // The native GBM surface. In EGL this represents the EGLNativeWindowType. | 51 // The native GBM surface. In EGL this represents the EGLNativeWindowType. |
48 gbm_surface* native_surface_; | 52 gbm_surface* native_surface_; |
49 | 53 |
50 // Buffer currently used for scanout. | 54 // Buffer currently used for scanout. |
51 gbm_bo* current_buffer_; | 55 gbm_bo* current_buffer_; |
52 | 56 |
53 gfx::Size size_; | 57 gfx::Size size_; |
54 | 58 |
| 59 base::WeakPtrFactory<GbmSurface> weak_factory_; |
| 60 |
55 DISALLOW_COPY_AND_ASSIGN(GbmSurface); | 61 DISALLOW_COPY_AND_ASSIGN(GbmSurface); |
56 }; | 62 }; |
57 | 63 |
58 } // namespace ui | 64 } // namespace ui |
59 | 65 |
60 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ | 66 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_H_ |
OLD | NEW |