OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ | 5 #ifndef CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |
6 #define CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ | 6 #define CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |
7 | 7 |
8 namespace chromecast { | 8 namespace chromecast { |
9 | 9 |
| 10 struct Size; |
| 11 |
10 // Interface representing all the hardware-specific elements of an Ozone | 12 // Interface representing all the hardware-specific elements of an Ozone |
11 // implementation for Cast. Supply an implementation of this interface | 13 // implementation for Cast. Supply an implementation of this interface |
12 // to OzonePlatformCast to create a complete Ozone implementation. | 14 // to OzonePlatformCast to create a complete Ozone implementation. |
13 class CastEglPlatform { | 15 class CastEglPlatform { |
14 public: | 16 public: |
15 struct Size { | |
16 Size(int w, int h) : width(w), height(h) {} | |
17 const int width; | |
18 const int height; | |
19 }; | |
20 | |
21 typedef void* (*GLGetProcAddressProc)(const char* name); | 17 typedef void* (*GLGetProcAddressProc)(const char* name); |
22 typedef void* NativeDisplayType; | 18 typedef void* NativeDisplayType; |
23 typedef void* NativeWindowType; | 19 typedef void* NativeWindowType; |
24 | 20 |
25 virtual ~CastEglPlatform() {} | 21 virtual ~CastEglPlatform() {} |
26 | 22 |
27 // Returns an array of EGL properties, which can be used in any EGL function | 23 // Returns an array of EGL properties, which can be used in any EGL function |
28 // used to select a display configuration. Note that all properties should be | 24 // used to select a display configuration. Note that all properties should be |
29 // immediately followed by the corresponding desired value and array should be | 25 // immediately followed by the corresponding desired value and array should be |
30 // terminated with EGL_NONE. Ownership of the array is not transferred to | 26 // terminated with EGL_NONE. Ownership of the array is not transferred to |
(...skipping 24 matching lines...) Expand all Loading... |
55 // Creates/destroys an EGLNativeWindow. There will be at most one window at a | 51 // Creates/destroys an EGLNativeWindow. There will be at most one window at a |
56 // time, created within a valid display type. | 52 // time, created within a valid display type. |
57 virtual NativeWindowType CreateWindow(NativeDisplayType display_type, | 53 virtual NativeWindowType CreateWindow(NativeDisplayType display_type, |
58 const Size& size) = 0; | 54 const Size& size) = 0; |
59 virtual void DestroyWindow(NativeWindowType window) = 0; | 55 virtual void DestroyWindow(NativeWindowType window) = 0; |
60 }; | 56 }; |
61 | 57 |
62 } // namespace chromecast | 58 } // namespace chromecast |
63 | 59 |
64 #endif // CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ | 60 #endif // CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |
OLD | NEW |