author | Matt Plumtree <matt.plumtree@nokia.com> |
Tue, 02 Nov 2010 09:46:02 +0000 | |
branch | bug235_bringup_0 |
changeset 72 | fd0a704154b9 |
parent 59 | d9b81aebba7b |
permissions | -rwxr-xr-x |
13 | 1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// Header file for guest egl implementation |
|
15 |
||
16 |
#ifndef EGLAPI_H_ |
|
17 |
#define EGLAPI_H_ |
|
18 |
||
59
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
13
diff
changeset
|
19 |
#define _DEBUG // FAISALMEMON temporary |
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
13
diff
changeset
|
20 |
|
13 | 21 |
// INCLUDES |
22 |
#include <e32std.h> |
|
23 |
#include <e32base.h> |
|
24 |
#include <e32hashtab.h> |
|
25 |
#include <w32std.h> |
|
26 |
#include <graphics/surface.h> |
|
27 |
#include <graphics/surfaceupdateclient.h> |
|
28 |
#include <pixelformats.h> |
|
29 |
#include <e32cmn.h> |
|
30 |
||
31 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
32 |
#include <sgresource/sgimage.h> |
|
33 |
#endif |
|
34 |
||
35 |
#define EGL_EGLEXT_PROTOTYPES |
|
36 |
#include <EGL/egl.h> |
|
37 |
||
38 |
class CEglSyncExtension; |
|
39 |
#include "remotefunctioncall.h" // data serialisation data types |
|
40 |
#include "eglsync.h" // EGL Sync extension |
|
41 |
#include "eglrfc.h" // data serialisation stuff |
|
42 |
#include "vghwutils.h" // VGHW Utils DLL |
|
43 |
#include "guestegl.h" // CGuestEGL class |
|
44 |
||
45 |
||
46 |
extern CGuestEGL* guestEGL; |
|
47 |
||
48 |
/* |
|
49 |
Change value to control how much tracing is generated in UDEB builds |
|
50 |
0 = API traces only |
|
51 |
1 = API traces and parameter validation diagnostics |
|
52 |
2 = API traces, param validation, extra diagnostics |
|
53 |
*/ |
|
54 |
#define EGL_TRACE_LEVEL 0 |
|
55 |
||
56 |
/* |
|
57 |
EGL version info |
|
58 |
*/ |
|
59 |
#define EGL_VERSION_MAJOR 1 |
|
60 |
#define EGL_VERSION_MINOR 4 |
|
61 |
#define MAKE_VERSION_STRING(major, minor) #major "." #minor |
|
62 |
||
63 |
// tracing |
|
64 |
#include <e32debug.h> |
|
65 |
#ifdef _DEBUG |
|
66 |
#define EGL_TRACE(fmt, args...) RDebug::Printf(fmt, ##args) |
|
67 |
#define EGL_TRACE_DETAIL(level, fmt, args...) if (level <= EGL_TRACE_LEVEL) RDebug::Printf(fmt, ##args) |
|
68 |
#define EGLPANIC_ASSERT(condition, panic) if (!(condition)) { EglPanic(panic, #panic, #condition, __FILE__, __LINE__); } |
|
69 |
#define EGLPANIC_ASSERT_DEBUG(condition, panic) if (!(condition)) { EglPanic(panic, #panic, #condition, __FILE__, __LINE__); } |
|
70 |
#define EGLPANIC_ALWAYS(panic) { EglPanic(panic, #panic, NULL, __FILE__, __LINE__); } |
|
71 |
#define EGLPANIC_DEBUG(panic) { EglPanic(panic, #panic, NULL, __FILE__, __LINE__); } |
|
72 |
#define EGL_TRACE_ATTRIB_LIST(aAttribList) TAttribUtils::TraceAttribList(aAttribList) |
|
73 |
#define EGL_TRACE_GET_ATTRIB(N, T, D, O, A, V, R) TAttribUtils::TraceGetAttrib(N, T, D, O, A, V, R) |
|
74 |
#define EGL_TRACE_SET_ATTRIB(N, T, D, O, A, V) TAttribUtils::TraceSetAttrib(N, T, D, O, A, V) |
|
75 |
#else |
|
76 |
#define EGL_TRACE(fmt, args...) |
|
77 |
#define EGL_TRACE_DETAIL(level, fmt, args...) |
|
78 |
#define EGLPANIC_ASSERT(condition, panic) if (!(condition)) { EglPanic(panic, NULL, NULL, NULL, __LINE__); } |
|
79 |
#define EGLPANIC_ASSERT_DEBUG(condition, panic) |
|
80 |
#define EGLPANIC_ALWAYS(panic) { EglPanic(panic, NULL, NULL, NULL, __LINE__); } |
|
81 |
#define EGLPANIC_DEBUG(panic) |
|
82 |
#define EGL_TRACE_ATTRIB_LIST(aAttribList) |
|
83 |
#define EGL_TRACE_GET_ATTRIB(N, T, D, O, A, V, R) |
|
84 |
#define EGL_TRACE_SET_ATTRIB(N, T, D, O, A, V) |
|
85 |
#endif |
|
86 |
||
87 |
||
88 |
// Guest EGL panic codes |
|
89 |
typedef enum |
|
90 |
{ |
|
91 |
EEglPanicCGuestEGLAllocFailed=1, |
|
92 |
EEglPanicDisplayMapLockCreateLocalFailed, |
|
93 |
EEglPanicGuestGraphicsAllocFailed, |
|
94 |
EEglPanicSgImageHandleInvalid, |
|
95 |
EEglPanicExtensionListAllocFailed, |
|
96 |
EEglPanicExtensionListCreationError, |
|
97 |
EEglPanicHostAndClientBoundApiOutOfSync, |
|
98 |
EEglPanicUnexpectedBoundApi, |
|
99 |
EEglPanicSymbianPixmapNotSetInSurface, |
|
100 |
EEglPanicSymbianWindowNotSetInSurface, // 10 |
|
101 |
EEglPanicHostAndClientEglInitOutOfSync, |
|
102 |
EEglPanicHostAndClientEglTerminateOutOfSync, |
|
103 |
EEglPanicErrorNotSet, |
|
104 |
EEglPanicThreadStateNotValidInInternalFunction, |
|
105 |
EEglPanicNotReplyOpcode, |
|
106 |
EEglPanicDisplayMapInsertFailed, |
|
107 |
EEglPanicEglSyncDisplayCreateFailed, |
|
108 |
EEglPanicReleaseInvalidDisplay, |
|
109 |
EEglPanicNullDisplayPointerInMap, |
|
110 |
EEglPanicLockedDisplayNotFound, // 20 |
|
111 |
EEglPanicStrayDisplayUnlock, |
|
112 |
EEglPanicDisplayNotLockedForWriting, |
|
113 |
EEglPanicDisplayAlreadyLocked, |
|
114 |
EEglPanicReadLockExpected, |
|
115 |
EEglPanicReadFromUnlockedDisplay, |
|
116 |
EEglPanicDisplayAlreadyInMap, |
|
117 |
EEglPanicDisplayNotFound, |
|
118 |
EEglPanicSgDriverCreateLocalFailed, |
|
119 |
EEglPanicInvalidNativePixmap, |
|
120 |
EEglPanicEglImageLockCreateLocalFailed, // 30 |
|
121 |
EEglPanicBadSgDriverVersion, |
|
122 |
EEglPanicEglImageRefCountNonZero, |
|
123 |
EEglPanicEglImageIsDestroyed, |
|
124 |
EEglPanicAtribListLengthTooLong, |
|
125 |
EEglPanicTemp, // temporary panic in development code |
|
126 |
} TEglPanic; |
|
127 |
||
128 |
void EglPanic(TEglPanic aPanicCode, char* aPanicName, char* aCondition, char* aFile, TInt aLine); |
|
129 |
||
130 |
||
131 |
inline CGuestEGL& Instance() |
|
132 |
{ |
|
133 |
CGuestEGL* result = (CGuestEGL*)guestEGL; // read value and cast away volatile attribute |
|
134 |
EGLPANIC_ASSERT(result, EEglPanicTemp); |
|
135 |
return *result; |
|
136 |
} |
|
137 |
||
138 |
#endif /* EGLAPI_H_ */ |