xref: /OK3568_Linux_fs/external/libmali/include/FBDEV/eglplatform.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun #ifndef __eglplatform_h_
2*4882a593Smuzhiyun #define __eglplatform_h_
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun /*
5*4882a593Smuzhiyun ** Copyright (c) 2007-2016 The Khronos Group Inc.
6*4882a593Smuzhiyun **
7*4882a593Smuzhiyun ** Permission is hereby granted, free of charge, to any person obtaining a
8*4882a593Smuzhiyun ** copy of this software and/or associated documentation files (the
9*4882a593Smuzhiyun ** "Materials"), to deal in the Materials without restriction, including
10*4882a593Smuzhiyun ** without limitation the rights to use, copy, modify, merge, publish,
11*4882a593Smuzhiyun ** distribute, sublicense, and/or sell copies of the Materials, and to
12*4882a593Smuzhiyun ** permit persons to whom the Materials are furnished to do so, subject to
13*4882a593Smuzhiyun ** the following conditions:
14*4882a593Smuzhiyun **
15*4882a593Smuzhiyun ** The above copyright notice and this permission notice shall be included
16*4882a593Smuzhiyun ** in all copies or substantial portions of the Materials.
17*4882a593Smuzhiyun **
18*4882a593Smuzhiyun ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19*4882a593Smuzhiyun ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20*4882a593Smuzhiyun ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21*4882a593Smuzhiyun ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22*4882a593Smuzhiyun ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23*4882a593Smuzhiyun ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24*4882a593Smuzhiyun ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25*4882a593Smuzhiyun */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun /* Platform-specific types and definitions for egl.h
28*4882a593Smuzhiyun  * $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
29*4882a593Smuzhiyun  *
30*4882a593Smuzhiyun  * Adopters may modify mali_khrplatform.h and this file to suit their platform.
31*4882a593Smuzhiyun  * You are encouraged to submit all modifications to the Khronos group so that
32*4882a593Smuzhiyun  * they can be included in future versions of this file.  Please submit changes
33*4882a593Smuzhiyun  * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
34*4882a593Smuzhiyun  * by filing a bug against product "EGL" component "Registry".
35*4882a593Smuzhiyun  */
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun #include <KHR/mali_khrplatform.h>
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun /* Macros used in EGL function prototype declarations.
40*4882a593Smuzhiyun  *
41*4882a593Smuzhiyun  * EGL functions should be prototyped as:
42*4882a593Smuzhiyun  *
43*4882a593Smuzhiyun  * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
44*4882a593Smuzhiyun  * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
45*4882a593Smuzhiyun  *
46*4882a593Smuzhiyun  * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/mali_khrplatform.h
47*4882a593Smuzhiyun  */
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #ifndef EGLAPI
50*4882a593Smuzhiyun #define EGLAPI KHRONOS_APICALL
51*4882a593Smuzhiyun #endif
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #ifndef EGLAPIENTRY
54*4882a593Smuzhiyun #define EGLAPIENTRY  KHRONOS_APIENTRY
55*4882a593Smuzhiyun #endif
56*4882a593Smuzhiyun #define EGLAPIENTRYP EGLAPIENTRY*
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
59*4882a593Smuzhiyun  * are aliases of window-system-dependent types, such as X Display * or
60*4882a593Smuzhiyun  * Windows Device Context. They must be defined in platform-specific
61*4882a593Smuzhiyun  * code below. The EGL-prefixed versions of Native*Type are the same
62*4882a593Smuzhiyun  * types, renamed in EGL 1.3 so all types in the API start with "EGL".
63*4882a593Smuzhiyun  *
64*4882a593Smuzhiyun  * Khronos STRONGLY RECOMMENDS that you use the default definitions
65*4882a593Smuzhiyun  * provided below, since these changes affect both binary and source
66*4882a593Smuzhiyun  * portability of applications using EGL running on different EGL
67*4882a593Smuzhiyun  * implementations.
68*4882a593Smuzhiyun  */
69*4882a593Smuzhiyun 
70*4882a593Smuzhiyun #include <stdint.h>
71*4882a593Smuzhiyun #include "mali_fbdev_types.h"
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun typedef fbdev_window * EGLNativeWindowType;
74*4882a593Smuzhiyun 
75*4882a593Smuzhiyun typedef int32_t EGLNativePixmapType;
76*4882a593Smuzhiyun 
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun typedef void * EGLNativeDisplayType;
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
81*4882a593Smuzhiyun typedef EGLNativeDisplayType NativeDisplayType;
82*4882a593Smuzhiyun typedef EGLNativePixmapType  NativePixmapType;
83*4882a593Smuzhiyun typedef EGLNativeWindowType  NativeWindowType;
84*4882a593Smuzhiyun 
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun /* Define EGLint. This must be a signed integral type large enough to contain
87*4882a593Smuzhiyun  * all legal attribute names and values passed into and out of EGL, whether
88*4882a593Smuzhiyun  * their type is boolean, bitmask, enumerant (symbolic constant), integer,
89*4882a593Smuzhiyun  * handle, or other.  While in general a 32-bit integer will suffice, if
90*4882a593Smuzhiyun  * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
91*4882a593Smuzhiyun  * integer type.
92*4882a593Smuzhiyun  */
93*4882a593Smuzhiyun typedef int32_t EGLint;
94*4882a593Smuzhiyun 
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun /* C++ / C typecast macros for special EGL handle values */
97*4882a593Smuzhiyun #if defined(__cplusplus)
98*4882a593Smuzhiyun #define EGL_CAST(type, value) (static_cast<type>(value))
99*4882a593Smuzhiyun #else
100*4882a593Smuzhiyun #define EGL_CAST(type, value) ((type) (value))
101*4882a593Smuzhiyun #endif
102*4882a593Smuzhiyun 
103*4882a593Smuzhiyun #endif /* __eglplatform_h */
104