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_PUBLIC_SURFACE_OZONE_EGL_H_ | 5 #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ | 6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/overlay_transform.h" | 10 #include "ui/gfx/overlay_transform.h" |
11 #include "ui/gfx/swap_result.h" | 11 #include "ui/gfx/swap_result.h" |
12 #include "ui/ozone/ozone_base_export.h" | 12 #include "ui/ozone/ozone_base_export.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Size; | 15 class Size; |
16 class VSyncProvider; | 16 class VSyncProvider; |
17 } | 17 } |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 class NativePixmap; | 20 class NativePixmap; |
21 | 21 |
22 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback; | 22 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback; |
23 | 23 |
24 // Holds callbacks to functions for configuring EGL on platform. | 24 // Holds callbacks to functions for configuring EGL on platform. |
25 struct OZONE_BASE_EXPORT EglConfigCallbacks { | 25 struct OZONE_BASE_EXPORT EglConfigCallbacks { |
26 EglConfigCallbacks(); | 26 EglConfigCallbacks(); |
| 27 EglConfigCallbacks(const EglConfigCallbacks& other); |
27 ~EglConfigCallbacks(); | 28 ~EglConfigCallbacks(); |
28 base::Callback<bool(const int32_t* attribs, | 29 base::Callback<bool(const int32_t* attribs, |
29 void** /* EGLConfig* */ configs, | 30 void** /* EGLConfig* */ configs, |
30 int32_t config_size, | 31 int32_t config_size, |
31 int32_t* num_configs)> | 32 int32_t* num_configs)> |
32 choose_config; | 33 choose_config; |
33 base::Callback< | 34 base::Callback< |
34 bool(void* /* EGLConfig */ config, int32_t attribute, int32_t* value)> | 35 bool(void* /* EGLConfig */ config, int32_t attribute, int32_t* value)> |
35 get_config_attribute; | 36 get_config_attribute; |
36 base::Callback<const char*()> get_last_error_string; | 37 base::Callback<const char*()> get_last_error_string; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 75 |
75 // Returns the EGL configuration to use for this surface. The default EGL | 76 // Returns the EGL configuration to use for this surface. The default EGL |
76 // configuration will be used if this returns nullptr. | 77 // configuration will be used if this returns nullptr. |
77 virtual void* /* EGLConfig */ GetEGLSurfaceConfig( | 78 virtual void* /* EGLConfig */ GetEGLSurfaceConfig( |
78 const EglConfigCallbacks& egl) = 0; | 79 const EglConfigCallbacks& egl) = 0; |
79 }; | 80 }; |
80 | 81 |
81 } // namespace ui | 82 } // namespace ui |
82 | 83 |
83 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ | 84 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ |
OLD | NEW |