|
1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 * |
|
3 * Permission is hereby granted, free of charge, to any person obtaining a |
|
4 * copy of this software and /or associated documentation files |
|
5 * (the "Materials "), to deal in the Materials without restriction, |
|
6 * including without limitation the rights to use, copy, modify, merge, |
|
7 * publish, distribute, sublicense, and/or sell copies of the Materials, |
|
8 * and to permit persons to whom the Materials are furnished to do so, |
|
9 * subject to the following conditions: |
|
10 * |
|
11 * The above copyright notice and this permission notice shall be included |
|
12 * in all copies or substantial portions of the Materials. |
|
13 * |
|
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
|
20 * THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
21 * |
|
22 * Initial Contributors: |
|
23 * Nokia Corporation - initial contribution. |
|
24 * |
|
25 * Contributors: |
|
26 * |
|
27 * Description: |
|
28 * |
|
29 */ |
|
30 |
|
31 #ifndef _EGLINTERNAL_H_ |
|
32 #define _EGLINTERNAL_H_ |
|
33 |
|
34 #include <EGL/egl.h> |
|
35 #include <vector> |
|
36 #include "VGInterface.h" |
|
37 #include "GLESInterface.h" |
|
38 #include "GLES2Interface.h" |
|
39 #include "eglDefinitions.h" |
|
40 #include "EGLStructs.h" |
|
41 #include "EGLUtils.h" |
|
42 |
|
43 class CEGLState; |
|
44 class CEGLThread; |
|
45 extern CEGLState* getState(); |
|
46 extern CEGLThread* getThread(); |
|
47 extern void setEGLError( EGLint error ); |
|
48 |
|
49 // Global EGL lock |
|
50 extern EGLI_LOCK g_eglLock; |
|
51 |
|
52 #define EGLI_ENTER_RET(ret)\ |
|
53 CEGLOs::GetLock( &g_eglLock );\ |
|
54 CEGLState* state = getState();\ |
|
55 if( !state )\ |
|
56 {\ |
|
57 CEGLOs::ReleaseLock( &g_eglLock );\ |
|
58 return ret;\ |
|
59 }\ |
|
60 CEGLProcess* process = state->GetCurrentProcess(); \ |
|
61 (void)process; |
|
62 |
|
63 #define EGLI_LEAVE_RET(ret, error)\ |
|
64 setEGLError( error );\ |
|
65 CEGLOs::ReleaseLock( &g_eglLock );\ |
|
66 return ret |
|
67 #endif // _EGLINTERNAL_H_ |