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 |
// Guest Egl Header file
|
|
15 |
|
|
16 |
#ifndef __GUEST__EGL_H
|
|
17 |
#define __GUEST__EGL_H
|
|
18 |
|
|
19 |
|
|
20 |
// CLASS DECLARATION
|
|
21 |
typedef enum
|
|
22 |
{
|
|
23 |
EPixmapTypeNone,
|
|
24 |
EPixmapTypeFbsBitmap,
|
|
25 |
EPixmapTypeSgImage,
|
|
26 |
} TSymbianPixmapTypeId;
|
|
27 |
|
|
28 |
|
|
29 |
typedef enum
|
|
30 |
{
|
|
31 |
ESurfaceTypeWindow = 0,
|
|
32 |
ESurfaceTypePbuffer = 1,
|
|
33 |
ESurfaceTypePixmapFbsBitmap = 2,
|
|
34 |
ESurfaceTypePixmapSgImage = 3,
|
|
35 |
} TEglSurfaceType;
|
|
36 |
|
|
37 |
|
|
38 |
class RSurfaceManager;
|
|
39 |
class CEglContext;
|
|
40 |
|
|
41 |
// client side info about a surface
|
|
42 |
struct TSurfaceInfo
|
|
43 |
{
|
|
44 |
TSize iSize;
|
|
45 |
TEglSurfaceType iSurfaceType; //Surface type
|
|
46 |
EGLConfig iConfigId;
|
|
47 |
CFbsBitmap* iFbsBitmap; // Handle for CFbsBitmap
|
|
48 |
#ifdef FAISALMEMON_S4_SGIMAGE
|
|
49 |
RSgDrawable iSgHandle; // Handle for RSgImge - keeps image open
|
|
50 |
TSgDrawableId iSgId; // SgImage Id - to detect 2nd attempted surface using the same SgImage
|
|
51 |
#endif
|
|
52 |
EGLSurface iHostSurfaceId;
|
|
53 |
// Note: most member data is only used by Window surfaces
|
|
54 |
TSurfaceId iSurfaceId; /*<! Target system surface allocated by EGL. */
|
|
55 |
// FAISALMEMON HOLE 0
|
|
56 |
void* iBuffer0; /*<! Pointer to the first buffer pixels */
|
|
57 |
void* iBuffer1; /*<! Pointer to the second buffer pixels */
|
|
58 |
TInt iBuffer0Index; /*<! Pointer to the first buffer pixels */
|
|
59 |
TInt iBuffer1Index; /*<! Pointer to the second buffer pixels */
|
|
60 |
RChunk* iChunk; /*<! chunk of the backbuffer surface memory */
|
|
61 |
// FAISALMEMON HOLE 1
|
|
62 |
RWindow* iNativeWindow;
|
|
63 |
EGLint iRedBits;
|
|
64 |
EGLint iGreenBits;
|
|
65 |
EGLint iBlueBits;
|
|
66 |
EGLint iAlphaBits;
|
|
67 |
EGLenum iAlphaFormat;
|
|
68 |
EGLint iColorBits;
|
|
69 |
EGLint iStride;
|
|
70 |
// FAISALMEMON HOLE 2
|
|
71 |
};
|
|
72 |
|
|
73 |
|
|
74 |
// Container for Symbian client side information about an EGL Display
|
|
75 |
NONSHARABLE_CLASS(CEglDisplayInfo) : public CBase
|
|
76 |
{
|
|
77 |
public:
|
|
78 |
TBool iInitialized;
|
|
79 |
// RMutex iSurfaceMapLock;
|
|
80 |
RHashMap<TInt, TSurfaceInfo*> iSurfaceMap;
|
|
81 |
//private:
|
|
82 |
// RMutex iContextMapLock;
|
|
83 |
RHashMap<EGLContext, CEglContext*> iContextMap;
|
|
84 |
};
|
|
85 |
|
|
86 |
|
|
87 |
// prototype to help eglGetProcAddress() API
|
|
88 |
typedef void (*ProcPointer)(...);
|
|
89 |
|
|
90 |
|
|
91 |
// Collection of static functions for processing EGL Attribute Lists
|
|
92 |
class TAttribUtils
|
|
93 |
{
|
|
94 |
public: // definitions in eglattribs.cpp
|
|
95 |
static TInt AttribListLength(const EGLint* aAttribList);
|
|
96 |
static const EGLint* FindAttribValue(const EGLint* aAttribList, EGLint aAttrib);
|
|
97 |
// NB only use these on AttribLists with adequate space for editing
|
|
98 |
static EGLint* FindAttribValue(EGLint* aAttribList, EGLint aAttrib);
|
|
99 |
static void AppendAttribValue(EGLint* aAttribList, EGLint aAttrib, EGLint aValue);
|
|
100 |
static void RemoveAttrib(EGLint* aAttribList, EGLint aAttrib);
|
|
101 |
#ifdef _DEBUG
|
|
102 |
// definitions in egldebug.cpp
|
|
103 |
static void TraceAttribList(const EGLint* aAttribList);
|
|
104 |
static void TraceAttribNames(EGLint aAttrib, EGLint aValue, char** aAttrName, char** aValueName);
|
|
105 |
static void TraceGetAttrib(char* aApiName, char* aObjType, EGLDisplay aDisplay, EGLint aObject, EGLint aAttribute, EGLint *aValue, EGLBoolean aResult);
|
|
106 |
static void TraceSetAttrib(char* aApiName, char* aObjType, EGLDisplay aDisplay, EGLint aObject, EGLint aAttribute, EGLint aValue);
|
|
107 |
#endif
|
|
108 |
};
|
|
109 |
|
|
110 |
|
|
111 |
// CEglContext represents an EGLContext on Host EGL
|
|
112 |
NONSHARABLE_CLASS(CEglContext) : public CBase
|
|
113 |
{
|
|
114 |
public:
|
|
115 |
// factory function
|
|
116 |
static CEglContext* Create(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, CEglContext* aShareContext, const EGLint* aAttribList);
|
|
117 |
EGLBoolean MakeCurrent(TEglThreadState& aThreadState, EGLSurface aDraw, EGLSurface aRead);
|
|
118 |
EGLBoolean QueryAttribute(TEglThreadState& aThreadState, EGLint aAttribute, EGLint* aValue);
|
|
119 |
// These functions return ETrue if they delete themselves
|
|
120 |
TBool Destroy(TEglThreadState& aThreadState);
|
|
121 |
TBool MakeNotCurrent(TEglThreadState& aThreadState);
|
|
122 |
EGLContext ShareContextFamily();
|
|
123 |
inline EGLContext HostContext() { return iHostContext; }
|
|
124 |
inline EGLContext ClientContext() { return iHostContext; }
|
|
125 |
inline TBool IsDestroyed() { return iIsDestroyed; }
|
|
126 |
|
|
127 |
private:
|
|
128 |
CEglContext(EGLDisplay aDisplay, EGLConfig aConfig, EGLContext aShareContextFamily, EGLenum aRenderingApi, EGLint aGlesClientVersion);
|
|
129 |
void Delete(TEglThreadState& aThreadState);
|
|
130 |
~CEglContext();
|
|
131 |
private:
|
|
132 |
RMutex iCtxMutex;
|
|
133 |
TBool iFirstUse; // for eglMakeCurrent
|
|
134 |
EGLContext iHostContext; // corresponding Host EGL Context
|
|
135 |
// info from eglCreateContext & eglMakeCurrent
|
|
136 |
EGLDisplay iDisplay;
|
|
137 |
EGLContext iShareContextFamily;
|
|
138 |
EGLConfig iConfigId; // Config id used to create context
|
|
139 |
EGLenum iRenderingApi; // set by current bound API at creation
|
|
140 |
EGLSurface iDrawSurface; // currently bound draw surface, if any
|
|
141 |
// for GL ES Contexts
|
|
142 |
EGLSurface iReadSurface; // currently bound read surface, if any
|
|
143 |
EGLint iGlesClientVersion; // set by EGL_CONTEXT_CLIENT_VERSION attribute at creation (default is 1)
|
|
144 |
// object lifetime management
|
|
145 |
TBool iIsDestroyed;
|
|
146 |
};
|
|
147 |
|
|
148 |
|
|
149 |
NONSHARABLE_CLASS(CEglImage) : public CBase
|
|
150 |
{
|
|
151 |
public:
|
|
152 |
CEglImage();
|
|
153 |
~CEglImage();
|
|
154 |
#ifdef FAISALMEMON_S4_SGIMAGE
|
|
155 |
inline void Create(TSgDrawableId aSgImageId, EGLDisplay aDisplay, TSgImageInfo& aSgImageInfo, TInt aPbufferHandle, VGHandle aVgHandle);
|
|
156 |
TSgDrawableId SgImageId() const;
|
|
157 |
#endif
|
|
158 |
inline void Duplicate();
|
|
159 |
inline TBool OpenForVgImage(TSize& aSize, VGHandle& aVgHandle, TUint64& aSgImageId);
|
|
160 |
inline TBool Close();
|
|
161 |
inline TBool Destroy();
|
|
162 |
inline TBool IsDestroyed() const;
|
|
163 |
inline TInt RefCount();
|
|
164 |
inline EGLDisplay Display() const;
|
|
165 |
|
|
166 |
private:
|
|
167 |
#ifdef FAISALMEMON_S4_SGIMAGE
|
|
168 |
RSgDrawable iSgHandle; // Client Handle
|
|
169 |
TSgImageInfo iSgImageInfo;
|
|
170 |
#endif
|
|
171 |
EGLDisplay iDisplay;
|
|
172 |
TInt iPbufferHandle; // Handle of the underlying Pbuffer, if any
|
|
173 |
VGHandle iVgHandle; // Handle of the underlying Host VgImage, if any
|
|
174 |
TInt iCreateCount;
|
|
175 |
TInt iOpenCount;
|
|
176 |
TBool iIsDestroyed;
|
|
177 |
};
|
|
178 |
|
|
179 |
const TInt KEglConfigSize = 29;
|
|
180 |
|
|
181 |
|
|
182 |
class XGuestEglInitialiser
|
|
183 |
{
|
|
184 |
public:
|
|
185 |
XGuestEglInitialiser();
|
|
186 |
~XGuestEglInitialiser();
|
|
187 |
};
|
|
188 |
|
|
189 |
|
|
190 |
/**
|
|
191 |
* CCGuestEGL
|
|
192 |
*
|
|
193 |
*/
|
|
194 |
NONSHARABLE_CLASS(CGuestEGL) : public CBase, public MEglManagementApi,
|
|
195 |
public MVgApiForEgl, public MGles11ApiForEgl, public MGles2ApiForEgl
|
|
196 |
{
|
|
197 |
public:
|
|
198 |
// Constructors and destructor
|
|
199 |
|
|
200 |
/**
|
|
201 |
* Destructor.
|
|
202 |
*/
|
|
203 |
~CGuestEGL();
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Public constructor.
|
|
207 |
*/
|
|
208 |
static CGuestEGL* New();
|
|
209 |
|
|
210 |
// class MEglManagementApi - exported as a vtable via CVghwUtils for Open VG and Open GL ES to access EGL info
|
|
211 |
virtual TBool EglImageOpenForVgImage(EGLImageKHR aImage, TSize& aSize, VGHandle& aVgHandle, TUint64& aSgImageId);
|
|
212 |
virtual void EglImageClose(EGLImageKHR aImage);
|
|
213 |
|
|
214 |
|
|
215 |
// Private interfaces for EGL to call into Open VG & Open GL ES
|
|
216 |
// class MVgApiForEgl - redirects via CVghwUtils to exported functions from Open VG
|
|
217 |
virtual ExtensionProcPointer guestGetVgProcAddress (const char *aProcName);
|
|
218 |
// class MGles11ApiForEgl - redirects via CVghwUtils to exported functions from Open GL ES 1.1
|
|
219 |
virtual ExtensionProcPointer guestGetGles11ProcAddress (const char *aProcName);
|
|
220 |
// class MGles2ApiForEgl - redirects via CVghwUtils to exported functions from Open GL ES 2
|
|
221 |
virtual ExtensionProcPointer guestGetGles2ProcAddress (const char *aProcName);
|
|
222 |
|
|
223 |
|
|
224 |
// public support functions for EGL C API
|
|
225 |
static EGLint CheckColorAttributes(const EGLint* aAttribList, EGLint aColorBufferType, EGLint aLuminanceBits,
|
|
226 |
EGLint aRedBits, EGLint aGreenBits, EGLint aBlueBits, EGLint aAlphaBits=0);
|
|
227 |
static void AppendColorAttributes(EGLint* aAttribList, EGLint aColorBufferType, EGLint aLuminanceBits, EGLint aRedBits,
|
|
228 |
EGLint aGreenBits, EGLint aBlueBits, EGLint aAlphaBits=0, TBool aSetVgPreMultAlpha=EFalse);
|
|
229 |
|
|
230 |
const char *QueryExtensionList();
|
|
231 |
|
|
232 |
// ToDo probably remove this after EGL Sync refactoring
|
|
233 |
void SetError( EGLint aError );
|
|
234 |
void DestroySurfaceInfo(EGLDisplay aDisplay, EGLSurface aSurface);
|
|
235 |
|
|
236 |
// static functions directly implementing an EGL API
|
|
237 |
ProcPointer eglGetProcAddress(const char *aProcName);
|
|
238 |
|
|
239 |
// functions directly implementing an EGL API
|
|
240 |
EGLBoolean eglBindTexImage(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aBuffer);
|
|
241 |
EGLBoolean eglChooseConfig(TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint *aAttribList,
|
|
242 |
EGLConfig *aConfigs, EGLint aConfigSize, EGLint *aNumConfig);
|
|
243 |
EGLBoolean eglCopyBuffers(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLNativePixmapType aTarget);
|
|
244 |
EGLContext eglCreateContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig,
|
|
245 |
EGLContext aShareContext, const EGLint *aAttribList);
|
|
246 |
EGLImageKHR eglCreateImageKHR(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLContext aContext, EGLenum aTarget,
|
|
247 |
EGLClientBuffer aBuffer, const EGLint *aAttribList);
|
|
248 |
EGLSurface eglCreatePbufferFromClientBuffer(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLenum aBufType,
|
|
249 |
EGLClientBuffer aBuffer, EGLConfig aConfig, const EGLint *aAttribList);
|
|
250 |
EGLSurface eglCreatePbufferSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const EGLint *aAttribList);
|
|
251 |
EGLSurface eglCreatePixmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig,
|
|
252 |
EGLNativePixmapType aNativePixmap, const EGLint *aAttribList);
|
|
253 |
EGLSurface eglCreateWindowSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig,
|
|
254 |
EGLNativeWindowType aNativeWindow, const EGLint *aAttribList);
|
|
255 |
EGLBoolean eglDestroyContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLContext aContext);
|
|
256 |
EGLBoolean eglDestroyImageKHR(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLImageKHR aImage);
|
|
257 |
EGLBoolean eglDestroySurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface);
|
|
258 |
EGLBoolean eglGetConfigAttrib(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig,
|
|
259 |
EGLint aAttribute, EGLint *aValue);
|
|
260 |
EGLBoolean eglGetConfigs(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig *aConfigs,
|
|
261 |
EGLint aConfigSize, EGLint *aNumConfig);
|
|
262 |
EGLContext eglGetCurrentContext(TEglThreadState& aThreadState);
|
|
263 |
EGLDisplay eglGetCurrentDisplay(TEglThreadState& aThreadState);
|
|
264 |
EGLSurface eglGetCurrentSurface(TEglThreadState& aThreadState, EGLint aReadDraw);
|
|
265 |
EGLDisplay eglGetDisplay(TEglThreadState& aThreadState, EGLNativeDisplayType aDisplayId);
|
|
266 |
EGLBoolean eglInitialize(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLint *aMajor, EGLint *aMinor);
|
|
267 |
EGLBoolean eglMakeCurrent(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aDraw, EGLSurface aRead,
|
|
268 |
EGLContext aContext);
|
|
269 |
EGLBoolean eglQueryContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLContext aContext, EGLint aAttribute, EGLint *aValue);
|
|
270 |
const char* eglQueryString(EGLDisplay aDisplay, EGLint aName);
|
|
271 |
EGLBoolean eglQuerySurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aAttribute,
|
|
272 |
EGLint *aValue);
|
|
273 |
EGLBoolean eglReleaseTexImage(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aBuffer);
|
|
274 |
EGLBoolean eglSurfaceAttrib(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface,
|
|
275 |
EGLint aAttribute, EGLint aValue);
|
|
276 |
EGLBoolean eglSwapBuffers(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface);
|
|
277 |
EGLBoolean eglSwapInterval(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLint aInterval);
|
|
278 |
EGLBoolean eglTerminate(TEglThreadState& aThreadState, EGLDisplay aDisplay);
|
|
279 |
EGLBoolean eglWaitClient(TEglThreadState& aThreadState);
|
|
280 |
|
|
281 |
public:
|
|
282 |
// API supporting EGL sync extension
|
|
283 |
/*-------------------------------------------------------------------*//*!
|
|
284 |
* \brief Query and request to lock a specified display
|
|
285 |
* \ingroup eglSync
|
|
286 |
* \param aEglDisplay a display identifier
|
|
287 |
* \return EGL_SUCCESS if successful;
|
|
288 |
* EGL_BAD_DISPLAY is not a name of a valid EGLDisplay
|
|
289 |
* EGL_NOT_INITIALIZED if the display object associated
|
|
290 |
* with the <aEglDisplay> has not been initialized
|
|
291 |
*//*-------------------------------------------------------------------*/
|
|
292 |
EGLint FindAndLockDisplay(EGLDisplay aDisplay);
|
|
293 |
|
|
294 |
/*-------------------------------------------------------------------*//*!
|
|
295 |
* \brief Releases the lock associated with a valid EGLDisplay
|
|
296 |
* \ingroup eglSync
|
|
297 |
* \param aEglDisplay a display identifier
|
|
298 |
*//*-------------------------------------------------------------------*/
|
|
299 |
void ReleaseDisplayLock(EGLDisplay aDisplay);
|
|
300 |
|
|
301 |
/*-------------------------------------------------------------------*//*!
|
|
302 |
* \brief Returns pointer to the EGL sync instance
|
|
303 |
* \ingroup eglSync
|
|
304 |
*//*-------------------------------------------------------------------*/
|
|
305 |
CEglSyncExtension* EGLSyncExtension();
|
|
306 |
|
|
307 |
private:
|
|
308 |
/**
|
|
309 |
* private constructor, 2nd phase constructor
|
|
310 |
*/
|
|
311 |
CGuestEGL();
|
|
312 |
void Create();
|
|
313 |
void CloseSgResources();
|
|
314 |
void OpenSgResources();
|
|
315 |
|
|
316 |
// private function with "EglInternalFunction_" prefix
|
|
317 |
TBool EglInternalFunction_CreateSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLConfig aConfig, RWindow* aNativeWindow, TSurfaceInfo& aSurfaceInfo);
|
|
318 |
void EglInternalFunction_DestroyWindowSurface(TSurfaceInfo& aSurfaceInfo);
|
|
319 |
TUidPixelFormat EglInternalFunction_GetSymbianPixelFormat(const TSurfaceInfo& aSurfaceInfo);
|
|
320 |
EGLBoolean EglInternalFunction_CallSetSurfaceParams(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, TSurfaceInfo& aSurfaceInfo);
|
|
321 |
TBool EglInternalFunction_PixmapSurfacePreviouslyCreated(EGLNativePixmapType pixmap, TSymbianPixmapTypeId pixmapType);
|
|
322 |
static TSymbianPixmapTypeId EglInternalFunction_GetNativePixmapType(EGLNativePixmapType pixmap);
|
|
323 |
const char* EglInternalFunction_QueryExtensionList();
|
|
324 |
TBool EglInternalFunction_IsValidNativePixmap(EGLNativePixmapType pixmap, TSymbianPixmapTypeId pixmapType);
|
|
325 |
EGLBoolean EglInternalFunction_SurfaceResized(TEglThreadState& aThreadState, TSurfaceInfo& aSurfaceInfo, EGLDisplay aDisplay, EGLSurface aSurface);
|
|
326 |
TSurfaceInfo* EglInternalFunction_GetPlatformSurface( EGLDisplay display, EGLSurface surface );
|
|
327 |
void EglInternalFunction_AbortWindowInit(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, TSurfaceInfo* ps, RWindow* window, CWsScreenDevice* screenDevice);
|
|
328 |
TBool EglInternalFunction_SwapWindowSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface);
|
|
329 |
TBool EglInternalFunction_MetaGetConfigs( TEglThreadState& aThreadState, EGLConfig*& aConfigs, EGLint& aConfigCnt, EGLint*& aConfigAttribs, EGLint& aConfigAttribsLen, TMetaGetConfigsMode aFetchMode = EMetaGetConfigsSg );
|
|
330 |
|
|
331 |
// more private functions
|
|
332 |
|
|
333 |
EGLint ConfigMatchesFbsBitmapPixmap(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const EGLint* aAttribList, TDisplayMode aMode);
|
|
334 |
EGLBoolean ChooseConfigForPixmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint* aAttribList, EGLConfig* aConfigs, EGLint aConfigSize,
|
|
335 |
EGLint* aNumConfig, const void* aPixmap);
|
|
336 |
EGLSurface CreateFbsBitmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, CFbsBitmap* aBitmap, const EGLint *aAttribList, TSurfaceInfo& aSurfaceInfo);
|
|
337 |
|
|
338 |
EGLint ChooseConfigAttribsForFbsBitmap(TEglThreadState& aThreadState, const EGLint* aAttribList, const CFbsBitmap* aBitmap, EGLint** aNewList);
|
|
339 |
|
|
340 |
EGLint ValidateEglImageTarget(EGLDisplay aDisplay, EGLContext aContext, EGLenum aTarget,
|
|
341 |
EGLClientBuffer aBuffer, const EGLint *aAttribList, TSymbianPixmapTypeId aTargetPixmapType);
|
|
342 |
|
|
343 |
|
|
344 |
TBool CreateDisplayInfo(EGLDisplay aDisplay);
|
|
345 |
TBool InitializeDisplayInfo(EGLDisplay aDisplay);
|
|
346 |
TBool IsDisplayInitialized(EGLDisplay aDisplay);
|
|
347 |
TBool DestroyDisplayInfo(EGLDisplay aDisplay);
|
|
348 |
|
|
349 |
#ifdef FAISALMEMON_S4_SGIMAGE
|
|
350 |
EGLSurface CreateSgImageSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const RSgImage* aSgImage, const EGLint *aAttribList,
|
|
351 |
TSurfaceInfo& aSurfaceInfo);
|
|
352 |
EGLImageKHR CreateNewEglImage(TEglThreadState& aThreadState, EGLDisplay aDisplay, TSgDrawableId aSgId, TSgImageInfo aSgImageInfo);
|
|
353 |
EGLImageKHR DuplicateEglImageIfItExists(EGLDisplay aDisplay, TSgDrawableId aSgId);
|
|
354 |
EGLint ChooseConfigAttribsForSgImage(TEglThreadState& aThreadState, const EGLint* aAttribList, const RSgImage* aSgImage, EGLint** aNewList);
|
|
355 |
EGLBoolean ChooseConfigForNativeSgImagePixmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint* aAttribList, EGLConfig* aConfigs, EGLint aConfigSize,
|
|
356 |
EGLint* aNumConfig, const EGLint* aPixmap);
|
|
357 |
#endif
|
|
358 |
private:
|
|
359 |
//new methods supporting EGL Sync extension
|
|
360 |
EGLint InitialiseExtensions();
|
|
361 |
|
|
362 |
private:
|
|
363 |
RReadWriteLock iDisplayMapLock; // protects the iDisplayMap for multi-threaded clients
|
|
364 |
RHashMap<TInt, CEglDisplayInfo*> iDisplayMap;
|
|
365 |
|
|
366 |
RMutex iEglImageLock; // protects the iEglImageArray for multi-threaded clients
|
|
367 |
RPointerArray<CEglImage> iEglImageArray; // ToDo use a Unique Id for the index/handle, rather than the object address
|
|
368 |
|
|
369 |
#ifdef FAISALMEMON_S4_SGIMAGE
|
|
370 |
EGLint* iSgConfigAttribs;
|
|
371 |
EGLint iSgConfigsAttribtCnt;
|
|
372 |
// ToDo (SgImage Design Spec 3.5) ARM EGL should maintain its own lists of native window handles, pixmap handles etc
|
|
373 |
|
|
374 |
char* iEglExtnNameList; // supporting data for eglQueryString()
|
|
375 |
RSgDriver iSgDriver;
|
|
376 |
#endif
|
|
377 |
//data members supporting EGL Sync extension
|
|
378 |
CEglSyncExtension* iEglSyncExtension;
|
|
379 |
// vtable pointers populated from CVghwUtils - to access Open VG & GL ES internals, e.g. to support eglGetProcAddress
|
|
380 |
MVgApiForEgl* iVgApiForEgl;
|
|
381 |
MGles11ApiForEgl* iGles11ApiForEgl;
|
|
382 |
MGles2ApiForEgl* iGles2ApiForEgl;
|
|
383 |
};
|
|
384 |
|
|
385 |
|
|
386 |
/* Execute host EGL functions that cannot fail
|
|
387 |
These functions do not set the flag to say that an EGL command has been executed since the last host eglGetError.
|
|
388 |
*/
|
|
389 |
|
|
390 |
inline EGLContext ExecEglContextNoErrorCmd(TEglThreadState& aThreadState, EglRFC& aEglApiData)
|
|
391 |
{
|
|
392 |
aThreadState.ExecuteEglNeverErrorCmd(aEglApiData);
|
|
393 |
return (EGLContext) aEglApiData.ReturnValue();
|
|
394 |
}
|
|
395 |
|
|
396 |
inline EGLSurface ExecEglSurfaceNoErrorCmd(TEglThreadState& aThreadState, EglRFC& aEglApiData)
|
|
397 |
{
|
|
398 |
aThreadState.ExecuteEglNeverErrorCmd(aEglApiData);
|
|
399 |
return (EGLSurface) aEglApiData.ReturnValue();
|
|
400 |
}
|
|
401 |
|
|
402 |
inline EGLDisplay ExecEglDisplayNoErrorCmd(TEglThreadState& aThreadState, EglRFC& aEglApiData)
|
|
403 |
{
|
|
404 |
aThreadState.ExecuteEglNeverErrorCmd(aEglApiData);
|
|
405 |
return (EGLDisplay) aEglApiData.ReturnValue();
|
|
406 |
}
|
|
407 |
|
|
408 |
|
|
409 |
#endif // __GUEST__EGL_H
|