author | Jon Medhurst |
Fri, 22 Oct 2010 13:33:46 +0100 | |
branch | bug235_bringup_0 |
changeset 63 | 13f031032ff1 |
parent 61 | 032a79db4ef1 |
child 65 | 3e31350c2490 |
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 |
// Guest EGL implementation |
|
15 |
||
16 |
#include <graphics/surfacemanager.h> |
|
17 |
#include <graphics/surfaceconfiguration.h> |
|
18 |
#include <graphics/suerror.h> |
|
19 |
#include <graphics/surface_hints.h> |
|
20 |
#include <e32debug.h> |
|
21 |
#include <stdlib.h> // for malloc |
|
22 |
#include "eglapi.h" |
|
23 |
||
24 |
#include <graphics/guestvideodriverinterfaceconstants.h> |
|
25 |
||
26 |
||
27 |
// FAISALMEMON HOLE 0 |
|
28 |
||
29 |
// ----------------------------------------------------------------------------- |
|
30 |
// constructor |
|
31 |
// ----------------------------------------------------------------------------- |
|
32 |
// |
|
33 |
||
34 |
// FAISALMEMON STUB CODE |
|
35 |
#define EGL_CHECK_ERROR(a, b, c) /* This does no checking; just a stub */ |
|
36 |
void CGuestEGL::EglInternalFunction_DestroyWindowSurface(TSurfaceInfo&) |
|
37 |
{ |
|
38 |
return; // stub code |
|
39 |
} |
|
40 |
||
41 |
EGLBoolean CGuestEGL::EglInternalFunction_SurfaceResized(TEglThreadState&, TSurfaceInfo&, int, int) |
|
42 |
{ |
|
43 |
return EFalse; // stub code |
|
44 |
} |
|
45 |
||
46 |
TBool CGuestEGL::EglInternalFunction_SwapWindowSurface(TEglThreadState&, int, int) |
|
47 |
{ |
|
48 |
return EFalse; // stub code |
|
49 |
} |
|
50 |
TSymbianPixmapTypeId CGuestEGL::EglInternalFunction_GetNativePixmapType(void*) |
|
51 |
{ |
|
52 |
return EPixmapTypeNone; // stub code |
|
53 |
} |
|
54 |
TBool CGuestEGL::EglInternalFunction_IsValidNativePixmap(void*, TSymbianPixmapTypeId) |
|
55 |
{ |
|
56 |
return EFalse; // stub code |
|
57 |
} |
|
58 |
const char * CGuestEGL::EglInternalFunction_QueryExtensionList() |
|
59 |
{ |
|
60 |
return NULL; // stub code |
|
61 |
} |
|
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
62 |
|
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
63 |
/** |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
64 |
Obtain extension function pointer. |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
65 |
|
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
66 |
Provide support for the Symbian Graphics SHAI for EGL Extensions |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
67 |
@param aName Name of extension |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
68 |
@return Function pointer, or NULL if not available. |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
69 |
|
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
70 |
@note Known extensions and their directly associated functions: |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
71 |
1. EGL_KHR_image |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
72 |
None |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
73 |
2. EGL_KHR_image_base |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
74 |
eglCreateImageKHR, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
75 |
eglDestroyImageKHR |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
76 |
3. EGL_KHR_image_pixmap |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
77 |
None |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
78 |
4. EGL_KHR_vg_parent_image |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
79 |
None |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
80 |
5. EGL_KHR_gl_texture_2D_image |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
81 |
None |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
82 |
6. EGL_KHR_gl_texture_cubemap_image |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
83 |
EGLImageTargetTexture2DOES, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
84 |
EGLImageTargetRenderbufferStorageOES |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
85 |
7. EGL_KHR_lock_surface2 |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
86 |
eglLockSurfaceKHR, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
87 |
eglUnlockSurfaceKHR |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
88 |
8. EGL_NOK_resource_profiling2 |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
89 |
eglQueryProfilingDataNOK |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
90 |
9. EGL_SYMBIAN_composition |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
91 |
None |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
92 |
10. EGL_NOK_image_endpoint |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
93 |
eglCreateEndpointNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
94 |
eglDestroyEndpointNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
95 |
eglGetEndpointAttribNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
96 |
eglSetEndpointAttribNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
97 |
eglEndpointBeginStreamingNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
98 |
eglEndpointEndStreamingNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
99 |
eglAcquireImageNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
100 |
eglReleaseImageNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
101 |
eglGetEndpointDirtyAreaNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
102 |
eglEndpointRequestNotificationNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
103 |
eglEndpointCancelNotificationNOK, |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
104 |
eglCreateEndpointNOK |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
105 |
11. NOK_pixmap_type_rsgimage |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
106 |
None |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
107 |
12. EGL_NOK_swap_region |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
108 |
eglSwapBuffersRegionNOK |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
109 |
|
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
110 |
@see Khronos EGL 1.4 Specification, eglGetProcAddress() |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
111 |
@author Faisal Memon Community EGL project |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
112 |
|
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
113 |
*/ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
114 |
ProcPointer CGuestEGL::eglGetProcAddress(const char* aName) |
13 | 115 |
{ |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
116 |
if (strncmp("eglCreateImageKHR", aName, strlen("eglCreateImageKHR")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
117 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
118 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
119 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
120 |
else if (strncmp("eglDestroyImageKHR", aName, strlen("eglDestroyImageKHR")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
121 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
122 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
123 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
124 |
else if (strncmp("EGLImageTargetTexture2DOES", aName, strlen("EGLImageTargetTexture2DOES")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
125 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
126 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
127 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
128 |
else if (strncmp("EGLImageTargetRenderbufferStorageOES", aName, strlen("EGLImageTargetRenderbufferStorageOES")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
129 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
130 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
131 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
132 |
else if (strncmp("eglLockSurfaceKHR", aName, strlen("eglLockSurfaceKHR")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
133 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
134 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
135 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
136 |
else if (strncmp("eglUnlockSurfaceKHR", aName, strlen("eglUnlockSurfaceKHR")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
137 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
138 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
139 |
} |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
140 |
else if (strncmp("EGL_KHR_lock_surface", aName, strlen("EGL_KHR_lock_surface")) == 0) |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
141 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
142 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
143 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
144 |
else if (strncmp("eglQueryProfilingDataNOK", aName, strlen("eglQueryProfilingDataNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
145 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
146 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
147 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
148 |
else if (strncmp("eglCreateEndpointNOK", aName, strlen("eglCreateEndpointNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
149 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
150 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
151 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
152 |
else if (strncmp("eglDestroyEndpointNOK", aName, strlen("eglDestroyEndpointNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
153 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
154 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
155 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
156 |
else if (strncmp("eglGetEndpointAttribNOK", aName, strlen("eglGetEndpointAttribNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
157 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
158 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
159 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
160 |
else if (strncmp("eglEndpointBeginStreamingNOK", aName, strlen("eglEndpointBeginStreamingNOK")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
161 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
162 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
163 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
164 |
else if (strncmp("eglEndpointEndStreamingNOK", aName, strlen("eglEndpointEndStreamingNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
165 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
166 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
167 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
168 |
else if (strncmp("eglAcquireImageNOK", aName, strlen("eglAcquireImageNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
169 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
170 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
171 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
172 |
else if (strncmp("eglReleaseImageNOK", aName, strlen("eglReleaseImageNOK")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
173 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
174 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
175 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
176 |
else if (strncmp("eglGetEndpointDirtyAreaNOK", aName, strlen("eglGetEndpointDirtyAreaNOK")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
177 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
178 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
179 |
} |
19
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
180 |
else if (strncmp("eglEndpointRequestNotificationNOK", aName, strlen("eglEndpointRequestNotificationNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
181 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
182 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
183 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
184 |
else if (strncmp("eglEndpointCancelNotificationNOK", aName, strlen("eglEndpointCancelNotificationNOK")) == 0) |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
185 |
{ |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
186 |
return NULL; |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
187 |
} |
da7c1a80df0d
Identify the actual EGL extension functions, just returning NULL for the moment. Prototype code, needs bring-up before testing
Faisal Memon <faisal.memon@nokia.com>
parents:
18
diff
changeset
|
188 |
else if (strncmp("eglCreateEndpointNOK", aName, strlen("eglCreateEndpointNOK")) == 0) |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
189 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
190 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
191 |
} |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
192 |
else if (strncmp("eglSwapBuffersRegionNOK", aName, strlen("eglSwapBuffersRegionNOK")) == 0) |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
193 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
194 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
195 |
} |
46
f7fe6b575f3c
Fixed incorrect case in eglGetProcAddress egl_Private_SignalSyncNOK
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
45
diff
changeset
|
196 |
else if (strncmp("egl_Private_SignalSyncNOK", aName, strlen("egl_Private_SignalSyncNOK")) == 0) |
44
02fdf3459799
add support for eglgetprocaddress for Egl_PrivateSignalSyncNOK
Faisal Memon <faisal.memon@nokia.com>
parents:
42
diff
changeset
|
197 |
{ |
02fdf3459799
add support for eglgetprocaddress for Egl_PrivateSignalSyncNOK
Faisal Memon <faisal.memon@nokia.com>
parents:
42
diff
changeset
|
198 |
return (ProcPointer)CEglSyncExtension::egl_Private_SignalSyncNOK; |
02fdf3459799
add support for eglgetprocaddress for Egl_PrivateSignalSyncNOK
Faisal Memon <faisal.memon@nokia.com>
parents:
42
diff
changeset
|
199 |
} |
47
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
200 |
else if (strncmp("eglCreateSyncKHR", aName, strlen("eglCreateSyncKHR")) == 0) |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
201 |
{ |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
202 |
return (ProcPointer)CEglSyncExtension::eglCreateSyncKHR; |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
203 |
} |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
204 |
else if (strncmp("eglDestroySyncKHR", aName, strlen("eglDestroySyncKHR")) == 0) |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
205 |
{ |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
206 |
return (ProcPointer)CEglSyncExtension::eglDestroySyncKHR; |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
207 |
} |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
208 |
else if (strncmp("eglClientWaitSyncKHR", aName, strlen("eglClientWaitSyncKHR")) == 0) |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
209 |
{ |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
210 |
return (ProcPointer)CEglSyncExtension::eglClientWaitSyncKHR; |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
211 |
} |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
212 |
else if (strncmp("eglSignalSyncKHR", aName, strlen("eglSignalSyncKHR")) == 0) |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
213 |
{ |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
214 |
return (ProcPointer)CEglSyncExtension::eglSignalSyncKHR; |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
215 |
} |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
216 |
else if (strncmp("eglGetSyncAttribKHR", aName, strlen("eglGetSyncAttribKHR")) == 0) |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
217 |
{ |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
218 |
return (ProcPointer)CEglSyncExtension::eglGetSyncAttribKHR; |
75fe64f1ad18
Added support for EGL sync extensions
Gareth Stockwell <gareth.stockwell@accenture.com>
parents:
46
diff
changeset
|
219 |
} |
18
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
220 |
else |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
221 |
{ |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
222 |
return NULL; |
3064c37a6509
Add TPIP-free implementation of eglGetProcAddress
Faisal Memon <faisal.memon@nokia.com>
parents:
17
diff
changeset
|
223 |
} |
13 | 224 |
} |
225 |
||
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
226 |
EGLSurface CGuestEGL::eglCreateWindowSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
227 |
EGLNativeWindowType aNativeWindow, const EGLint *aAttribList) |
13 | 228 |
{ |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
229 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
230 |
// FAISALMEMON NEW |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
231 |
/** |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
232 |
* pseudo code: |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
233 |
* |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
234 |
* surfacemamanger. |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
235 |
* open() |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
236 |
* createsurface(2 buffers, width, height, pixel format,...) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
237 |
* map surface -> get chunk |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
238 |
* serialization.eglCreateWindowSurface(..) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
239 |
* eglinternalfunctioncreatesurface(chunk, width, height, ..) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
240 |
* egl.... setwindowsurfacebuffers(...) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
241 |
* surfaceupdatesession.connect() |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
242 |
* wnd.setbackgroundsurface() |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
243 |
*/ |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
244 |
EGL_TRACE( "CGuestEGL::eglCreateWindowSurface"); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
245 |
EGL_TRACE_ATTRIB_LIST(aAttribList); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
246 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
247 |
RWindow* window; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
248 |
window = (RWindow*) aNativeWindow; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
249 |
TSize size = window->Size(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
250 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
251 |
TSurfaceInfo* surfaceInfo = NULL; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
252 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
253 |
RSurfaceManager::TSurfaceCreationAttributesBuf buf; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
254 |
RSurfaceManager::TSurfaceCreationAttributes& attributes = buf(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
255 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
256 |
attributes.iSize = size; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
257 |
attributes.iBuffers = 2; // REQUIREMENT because host side assumes exactly two buffers |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
258 |
attributes.iPixelFormat = EUidPixelFormatARGB_8888; // this is a guess; either query or hardcode to match syborg |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
259 |
attributes.iStride = 4 * size.iWidth; // Number of bytes between start of one line and start of next |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
260 |
attributes.iOffsetToFirstBuffer = 0; |
41
2110890eb027
Fixed compile. This change now provides alpha support for the integration of guestegl with the host
Faisal Memon <faisal.memon@nokia.com>
parents:
40
diff
changeset
|
261 |
attributes.iAlignment = RSurfaceManager::EPageAligned; // alignment, 1,2,4,8,16,32,64 byte aligned or EPageAligned |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
262 |
attributes.iHintCount=0; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
263 |
attributes.iSurfaceHints = NULL; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
264 |
attributes.iOffsetBetweenBuffers = 0; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
265 |
attributes.iContiguous = ETrue; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
266 |
attributes.iCacheAttrib = RSurfaceManager::ENotCached; // Cache attributes |
59
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
267 |
attributes.iMappable = ETrue; |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
268 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
269 |
iDisplayMapLock.WriteLock(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
270 |
CEglDisplayInfo** pDispInfo; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
271 |
pDispInfo = iDisplayMap.Find(aDisplay); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
272 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
273 |
if (pDispInfo && *pDispInfo) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
274 |
{ |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
275 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
276 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
277 |
surfaceInfo = new TSurfaceInfo(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
278 |
if (surfaceInfo) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
279 |
{ |
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
280 |
surfaceInfo->iNativeWindow = (RWindow*)aNativeWindow; |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
281 |
surfaceInfo->iConfigId = aConfig; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
282 |
surfaceInfo->iSurfaceManager.Open(); |
63
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
283 |
surfaceInfo->iSurfaceManager.CreateSurface(buf, surfaceInfo->iSurfaceId); |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
284 |
TInt err = surfaceInfo->iSurfaceManager.MapSurface(surfaceInfo->iSurfaceId, surfaceInfo->iChunk); |
59
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
285 |
EGL_TRACE("CGuestEGL::eglCreateWindowSurface surface manager returned chunk %x and ret val %d", surfaceInfo->iChunk, err); |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
286 |
RemoteFunctionCallData rfcdata; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
287 |
EglRFC eglApiData( rfcdata ); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
288 |
eglApiData.Init( EglRFC::EeglCreateWindowSurface); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
289 |
eglApiData.AppendEGLDisplay(aDisplay); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
290 |
eglApiData.AppendEGLConfig(aConfig); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
291 |
eglApiData.AppendEGLNativeWindowType(aNativeWindow); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
292 |
eglApiData.AppendEGLintVector(aAttribList, TAttribUtils::AttribListLength(aAttribList) ); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
293 |
eglApiData.AppendEGLint(size.iWidth); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
294 |
eglApiData.AppendEGLint(size.iHeight); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
295 |
eglApiData.AppendEGLint(1000); // horizontalPitch arbitrary |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
296 |
eglApiData.AppendEGLint(1000); // verticalPitch arbitrary |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
297 |
surfaceInfo->iHostSurfaceId = aThreadState.ExecEglSurfaceCmd(eglApiData); // todo check if is valid |
41
2110890eb027
Fixed compile. This change now provides alpha support for the integration of guestegl with the host
Faisal Memon <faisal.memon@nokia.com>
parents:
40
diff
changeset
|
298 |
(*pDispInfo)->iSurfaceMap.Insert(surfaceInfo->iHostSurfaceId, surfaceInfo); |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
299 |
EglInternalFunction_CreateSurface(aThreadState, aDisplay, surfaceInfo->iHostSurfaceId, aConfig, window, *surfaceInfo); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
300 |
surfaceInfo->iSurfaceUpdateSession.Connect(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
301 |
TSurfaceConfiguration surfaceConfig; |
63
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
302 |
surfaceConfig.SetSurfaceId(surfaceInfo->iSurfaceId); |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
303 |
window->SetBackgroundSurface(surfaceConfig, ETrue); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
304 |
} |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
305 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
306 |
} |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
307 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
308 |
iDisplayMapLock.Unlock(); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
309 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
310 |
aThreadState.SetEglError(EGL_SUCCESS); |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
311 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
312 |
return surfaceInfo->iHostSurfaceId; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
313 |
|
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
314 |
// FAISALMEMON END OF NEW |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
315 |
|
13 | 316 |
} |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
317 |
|
13 | 318 |
const char* CGuestEGL::eglQueryString(EGLDisplay aDisplay, EGLint aName) |
319 |
{ |
|
50
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
320 |
RemoteFunctionCallData rfcdata; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
321 |
EglRFC eglApiData( rfcdata ); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
322 |
eglApiData.Init( EglRFC::EeglQueryString ); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
323 |
eglApiData.AppendEGLDisplay(aDisplay); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
324 |
eglApiData.AppendEGLint(aName); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
325 |
TEglThreadState* threadState = CVghwUtils::CreateThreadState(); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
326 |
EGLBoolean result = EGL_FALSE; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
327 |
if (threadState) |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
328 |
{ |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
329 |
/* |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
330 |
* This command is pointless at the moment. We actually want the host |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
331 |
* to return a string, not a boolean. The serialization interface does |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
332 |
* not currently support the returning of strings from the host side, |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
333 |
* so there is no way to get back the result of the query properly. |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
334 |
* |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
335 |
* We should improve the guest/host interface to add this support. Then |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
336 |
* this code can be made "useful". At the moment, returning true means |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
337 |
* the host knows about the extension and wants to reply with a non-NULL |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
338 |
* string. |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
339 |
*/ |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
340 |
result = threadState->ExecEglBooleanCmd(eglApiData); |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
341 |
if (result == EGL_FALSE) |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
342 |
{ |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
343 |
return NULL; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
344 |
} |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
345 |
} |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
346 |
|
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
347 |
switch (aName) |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
348 |
{ |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
349 |
case EGL_CLIENT_APIS: |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
350 |
return "OpenVG OpenGL_ES OpenGL_ES2"; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
351 |
case EGL_EXTENSIONS: |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
352 |
return "KHR_reusable_sync EGL_SYMBIAN_COMPOSITION"; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
353 |
case EGL_VENDOR: |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
354 |
return "Symbian Foundation"; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
355 |
case EGL_VERSION: |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
356 |
return "1.4 guestegl"; |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
357 |
} |
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
358 |
|
a7fcb1229472
Add support for eglQueryString. Its partially fake support because the serialization interface does not support the return of string data
Faisal Memon <faisal.memon@nokia.com>
parents:
47
diff
changeset
|
359 |
return NULL; |
13 | 360 |
} |
361 |
// FAISALMEMON END OF STUB CODE |
|
362 |
||
363 |
CGuestEGL::CGuestEGL() : |
|
364 |
iEglSyncExtension(NULL) |
|
365 |
{ |
|
366 |
} |
|
367 |
||
368 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
369 |
void CGuestEGL::OpenSgResources() |
|
370 |
{ |
|
371 |
// ToDo delay opening SgDriver until needed, as it force loads Open GL ES 1.1, GL ES 2 and Open VG DLLs if it finds them |
|
372 |
TInt err = iSgDriver.Open(); |
|
373 |
EGL_TRACE(" CGuestEGL::Create SgDriver.Open err=%d", err); |
|
374 |
EGLPANIC_ASSERT(err == KErrNone, EEglPanicSgDriverCreateLocalFailed); |
|
375 |
||
376 |
TVersion sgImageVer = RSgDriver::Version(); |
|
377 |
EGL_TRACE(" CGuestEGL::Create sgImageVer=%d.%d", sgImageVer.iMajor, sgImageVer.iMinor); |
|
378 |
EGLPANIC_ASSERT(sgImageVer.iMajor == 1, EEglPanicBadSgDriverVersion); |
|
379 |
||
380 |
} |
|
381 |
void CGuestEGL::CloseSgResources() |
|
382 |
{ |
|
383 |
iSgDriver.Close(); |
|
384 |
} |
|
385 |
#else |
|
386 |
void CGuestEGL::CloseSgResources() |
|
387 |
{ |
|
388 |
} |
|
389 |
||
390 |
void CGuestEGL::OpenSgResources() |
|
391 |
{ |
|
392 |
} |
|
393 |
#endif |
|
394 |
||
395 |
// ----------------------------------------------------------------------------- |
|
396 |
// destructor |
|
397 |
// ----------------------------------------------------------------------------- |
|
398 |
// |
|
399 |
CGuestEGL::~CGuestEGL() |
|
400 |
{ |
|
401 |
EGL_TRACE("CGuestEGL::~CGuestEGL"); |
|
402 |
// only expected to be called during process termination |
|
403 |
if (iEglSyncExtension) |
|
404 |
{ |
|
405 |
delete iEglSyncExtension; |
|
406 |
iEglSyncExtension = NULL; |
|
407 |
} |
|
408 |
iDisplayMapLock.Close(); |
|
409 |
CloseSgResources(); |
|
410 |
iEglImageLock.Close(); |
|
411 |
} |
|
412 |
||
413 |
// ----------------------------------------------------------------------------- |
|
414 |
// 2nd phase constructor |
|
415 |
// ----------------------------------------------------------------------------- |
|
416 |
// |
|
417 |
void CGuestEGL::Create() |
|
418 |
{ |
|
419 |
EGL_TRACE(" CGuestEGL::Create -->"); |
|
420 |
OpenSgResources(); |
|
421 |
TInt err; |
|
422 |
err = iDisplayMapLock.CreateLocal(); |
|
423 |
EGLPANIC_ASSERT(err == KErrNone, EEglPanicDisplayMapLockCreateLocalFailed); |
|
424 |
||
425 |
err = iEglImageLock.CreateLocal(); |
|
426 |
EGLPANIC_ASSERT(err == KErrNone, EEglPanicEglImageLockCreateLocalFailed); |
|
427 |
||
428 |
InitialiseExtensions(); |
|
429 |
||
430 |
const char* initExtensionList = EglInternalFunction_QueryExtensionList(); |
|
431 |
EGL_TRACE(" CGuestEGL::Create initExtensionList=0x%x (\"%s\") <--", |
|
432 |
initExtensionList, initExtensionList ? initExtensionList : ""); |
|
433 |
} |
|
434 |
||
435 |
// ----------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
// ----------------------------------------------------------------------------- |
|
438 |
// |
|
439 |
CGuestEGL* CGuestEGL::New() |
|
440 |
{ |
|
441 |
EGL_TRACE("CGuestEGL::New start -->"); |
|
442 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
443 |
CGuestEGL* result = new CGuestEGL(); |
|
444 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
445 |
EGLPANIC_ASSERT(result, EEglPanicGuestGraphicsAllocFailed); |
|
446 |
if (result) |
|
447 |
{ |
|
448 |
result->Create(); |
|
449 |
} |
|
450 |
EGL_TRACE("CGuestEGL::New end - result=0x%x <--", result); |
|
451 |
return result; |
|
452 |
} |
|
453 |
||
454 |
// ----------------------------------------------------------------------------- |
|
455 |
// |
|
456 |
// ----------------------------------------------------------------------------- |
|
457 |
// |
|
458 |
void CGuestEGL::SetError(EGLint aError) |
|
459 |
{ // ToDo remove - everything except EGL Sync already uses threadState->SetEglError |
|
460 |
EGL_TRACE( "CGuestEGL::SetError EGL error=0x%x", aError); |
|
461 |
TEglThreadState* threadState = CVghwUtils::EglThreadState(); |
|
462 |
if (threadState) |
|
463 |
{ |
|
464 |
threadState->SetEglError(aError); |
|
465 |
} |
|
466 |
} |
|
467 |
||
468 |
EGLint CGuestEGL::CheckColorAttributes(const EGLint* aAttribList, EGLint aColorBufferType, EGLint aLuminanceBits, EGLint aRedBits, |
|
469 |
EGLint aGreenBits, EGLint aBlueBits, EGLint aAlphaBits) |
|
470 |
{ |
|
471 |
const EGLint* pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_COLOR_BUFFER_TYPE); |
|
472 |
if (pValue && (*pValue != aColorBufferType)) |
|
473 |
{ |
|
474 |
return EGL_BAD_MATCH; |
|
475 |
} |
|
476 |
EGLint colorBits = 0; |
|
477 |
if (aColorBufferType == EGL_RGB_BUFFER) |
|
478 |
{ |
|
479 |
colorBits = aRedBits + aGreenBits + aBlueBits + aAlphaBits; |
|
480 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_RED_SIZE); |
|
481 |
if (pValue && (*pValue < aRedBits)) |
|
482 |
{ |
|
483 |
return EGL_BAD_MATCH; |
|
484 |
} |
|
485 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_GREEN_SIZE); |
|
486 |
if (pValue && (*pValue < aGreenBits)) |
|
487 |
{ |
|
488 |
return EGL_BAD_MATCH; |
|
489 |
} |
|
490 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_BLUE_SIZE); |
|
491 |
if (pValue && (*pValue < aBlueBits)) |
|
492 |
{ |
|
493 |
return EGL_BAD_MATCH; |
|
494 |
} |
|
495 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_LUMINANCE_SIZE); |
|
496 |
if (pValue && (*pValue != 0)) |
|
497 |
{ |
|
498 |
return EGL_BAD_MATCH; |
|
499 |
} |
|
500 |
} |
|
501 |
else |
|
502 |
{ // EGL_LUMINANCE_BUFFER |
|
503 |
colorBits = aLuminanceBits + aAlphaBits; |
|
504 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_RED_SIZE); |
|
505 |
if (pValue && (*pValue != 0)) |
|
506 |
{ |
|
507 |
return EGL_BAD_MATCH; |
|
508 |
} |
|
509 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_GREEN_SIZE); |
|
510 |
if (pValue && (*pValue != 0)) |
|
511 |
{ |
|
512 |
return EGL_BAD_MATCH; |
|
513 |
} |
|
514 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_BLUE_SIZE); |
|
515 |
if (pValue && (*pValue != 0)) |
|
516 |
{ |
|
517 |
return EGL_BAD_MATCH; |
|
518 |
} |
|
519 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_LUMINANCE_SIZE); |
|
520 |
if (pValue && (*pValue < aLuminanceBits)) |
|
521 |
{ |
|
522 |
return EGL_BAD_MATCH; |
|
523 |
} |
|
524 |
} |
|
525 |
||
526 |
if (aAlphaBits) |
|
527 |
{ |
|
528 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_ALPHA_SIZE); |
|
529 |
if (pValue && (*pValue < aAlphaBits)) |
|
530 |
{ |
|
531 |
return EGL_BAD_MATCH; |
|
532 |
} |
|
533 |
} |
|
534 |
||
535 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_BUFFER_SIZE); |
|
536 |
if (pValue && (*pValue < colorBits)) |
|
537 |
{ |
|
538 |
return EGL_BAD_MATCH; |
|
539 |
} |
|
540 |
return EGL_SUCCESS; |
|
541 |
} |
|
542 |
||
543 |
void CGuestEGL::AppendColorAttributes(EGLint* aAttribList, EGLint aColorBufferType, EGLint aLuminanceBits, EGLint aRedBits, |
|
544 |
EGLint aGreenBits, EGLint aBlueBits, EGLint aAlphaBits, TBool aSetVgPreMultAlpha) |
|
545 |
{ |
|
546 |
const EGLint* pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_COLOR_BUFFER_TYPE); |
|
547 |
if (!pValue) |
|
548 |
{ |
|
549 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_COLOR_BUFFER_TYPE, aColorBufferType); |
|
550 |
} |
|
551 |
||
552 |
EGLint colorBits = 0; |
|
553 |
if (aColorBufferType == EGL_RGB_BUFFER) |
|
554 |
{ |
|
555 |
colorBits = aRedBits + aGreenBits + aBlueBits + aAlphaBits; |
|
556 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_RED_SIZE); |
|
557 |
if (!pValue) |
|
558 |
{ |
|
559 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_RED_SIZE, aRedBits); |
|
560 |
} |
|
561 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_GREEN_SIZE); |
|
562 |
if (!pValue) |
|
563 |
{ |
|
564 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_GREEN_SIZE, aGreenBits); |
|
565 |
} |
|
566 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_BLUE_SIZE); |
|
567 |
if (!pValue) |
|
568 |
{ |
|
569 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_BLUE_SIZE, aBlueBits); |
|
570 |
} |
|
571 |
} |
|
572 |
else |
|
573 |
{ // EGL_LUMINANCE_BUFFER |
|
574 |
colorBits = aLuminanceBits + aAlphaBits; |
|
575 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_LUMINANCE_SIZE); |
|
576 |
if (!pValue) |
|
577 |
{ |
|
578 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_LUMINANCE_SIZE, aLuminanceBits); |
|
579 |
} |
|
580 |
} |
|
581 |
||
582 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_BUFFER_SIZE); |
|
583 |
if (!pValue) |
|
584 |
{ |
|
585 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_BUFFER_SIZE, colorBits); |
|
586 |
} |
|
587 |
||
588 |
if (aAlphaBits) |
|
589 |
{ |
|
590 |
pValue = TAttribUtils::FindAttribValue(aAttribList, EGL_ALPHA_SIZE); |
|
591 |
if (!pValue) |
|
592 |
{ |
|
593 |
TAttribUtils::AppendAttribValue(aAttribList, EGL_ALPHA_SIZE, aAlphaBits); |
|
594 |
} |
|
595 |
} |
|
596 |
if (aSetVgPreMultAlpha) |
|
597 |
{ |
|
598 |
EGLint* pSurfaceType = TAttribUtils::FindAttribValue(aAttribList, EGL_SURFACE_TYPE); |
|
599 |
if (pSurfaceType) |
|
600 |
{ |
|
601 |
*pSurfaceType |= EGL_VG_ALPHA_FORMAT_PRE_BIT; |
|
602 |
} |
|
603 |
} |
|
604 |
} |
|
605 |
||
606 |
EGLBoolean CGuestEGL::ChooseConfigForPixmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint* aAttribList, EGLConfig* aConfigs, EGLint aConfigSize, |
|
607 |
EGLint* aNumConfig, const void* aPixmap) |
|
608 |
{ |
|
609 |
EGLint error = EGL_SUCCESS; |
|
610 |
EGLint* newList = NULL; |
|
611 |
||
612 |
switch ( EglInternalFunction_GetNativePixmapType((EGLNativePixmapType) (aPixmap)) ) |
|
613 |
{ |
|
614 |
case EPixmapTypeFbsBitmap: |
|
615 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 1.a pixmap type is FbsBitmap (aPixmap=0x%x)", aPixmap); |
|
616 |
error = ChooseConfigAttribsForFbsBitmap(aThreadState, aAttribList, reinterpret_cast<const CFbsBitmap*>(aPixmap), &newList); |
|
617 |
break; |
|
618 |
||
619 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
620 |
case EPixmapTypeSgImage: |
|
621 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 1.b pixmap type is SgImage (aPixmap=0x%x)", aPixmap); |
|
622 |
error = ChooseConfigAttribsForSgImage(aThreadState, aAttribList, reinterpret_cast<const RSgImage*>(aPixmap), &newList); |
|
623 |
break; |
|
624 |
#endif |
|
625 |
||
626 |
case EPixmapTypeNone: |
|
627 |
default: |
|
628 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 1.c pixmap type is unknown (aPixmap=0x%x)", aPixmap); |
|
629 |
error = EGL_BAD_NATIVE_PIXMAP; |
|
630 |
break; |
|
631 |
} |
|
632 |
||
633 |
if (error != EGL_SUCCESS) |
|
634 |
{ |
|
635 |
aThreadState.SetEglError(error); |
|
636 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 2.a encountered error=0x%x", error); |
|
637 |
if (newList) |
|
638 |
{ |
|
639 |
CVghwUtils::Free(newList); |
|
640 |
} |
|
641 |
return EGL_FALSE; |
|
642 |
} |
|
643 |
||
644 |
EGLPANIC_ASSERT(newList, EEglPanicTemp); |
|
645 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 2.b temp AttribList ... (*newList=0x%x)", *newList); |
|
646 |
EGL_TRACE_ATTRIB_LIST(newList); |
|
647 |
||
648 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
649 |
eglApiData.Init( EglRFC::EeglChooseConfig ); |
|
650 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
651 |
eglApiData.AppendEGLintVector(newList, TAttribUtils::AttribListLength(newList) ); |
|
652 |
eglApiData.AppendEGLConfigVector(aConfigs, aConfigSize, RemoteFunctionCallData::EOut); |
|
653 |
eglApiData.AppendEGLint(aConfigSize); |
|
654 |
eglApiData.AppendEGLintVector(aNumConfig, 1, RemoteFunctionCallData::EOut); |
|
655 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
656 |
EGL_TRACE("CGuestEGL::ChooseConfigForPixmapSurface 3. Host EGL success=%d", result); |
|
657 |
||
658 |
CVghwUtils::Free(newList); |
|
659 |
return result; |
|
660 |
} |
|
661 |
||
662 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
663 |
EGLBoolean CGuestEGL::ChooseConfigForNativeSgImagePixmapSurface( TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint* aAttribList, EGLConfig* aConfigs, EGLint aConfigSize, |
|
664 |
EGLint* aNumConfig, const EGLint* aPixmap ) |
|
665 |
{ |
|
666 |
EGLConfig* sgConfigs; |
|
667 |
EGLint sgConfigCnt; |
|
668 |
TBool* sgConfigsMatchingAttributes; |
|
669 |
TInt sgConfigsMatchingAttributesCnt=0; |
|
670 |
EGLint* sgConfigAttribs; |
|
671 |
EGLint sgConfigsAttribtCnt; |
|
672 |
EGL_TRACE( "CGuestEGL::eglChooseConfig: ChooseConfigForNativePixmapSurface" ); |
|
673 |
EglInternalFunction_MetaGetConfigs( aThreadState, sgConfigs, sgConfigCnt, sgConfigAttribs, sgConfigsAttribtCnt ); |
|
674 |
EGL_TRACE( "EglInternalFunction_MetaGetConfigAttirb cnt = %d ", sgConfigsAttribtCnt ); |
|
675 |
||
676 |
sgConfigsMatchingAttributes = new TBool[sgConfigCnt]; |
|
677 |
||
678 |
TInt attribs_per_config = EglRFC::MetaGetConfigAttributeCnt(); |
|
679 |
TInt configcnt = (TInt) sgConfigsAttribtCnt / attribs_per_config; |
|
680 |
EGL_TRACE( "EglInternalFunction_MetaGetConfigs cnt = %d ", configcnt ); |
|
681 |
||
682 |
//The attribute values of aAttribList, in the order of MetaGetConfigAttribute(i) |
|
683 |
EGLint* specAttribVals = new EGLint[ attribs_per_config ]; |
|
684 |
for( TInt i=0;i<attribs_per_config;++i ) |
|
685 |
{ |
|
686 |
*( specAttribVals + i ) = -1; |
|
687 |
} |
|
688 |
int spec_attrib_kind; |
|
689 |
int i_spec_attrib = 0; |
|
690 |
//Go through all the given attributes |
|
691 |
while( (spec_attrib_kind = *(aAttribList + i_spec_attrib )) != EGL_NONE ) |
|
692 |
{ |
|
693 |
//Check which type of attribute is specified, then set the value if types match |
|
694 |
for( TInt i=0;i<attribs_per_config;++i ) |
|
695 |
{ |
|
696 |
if( spec_attrib_kind == EglRFC::MetaGetConfigAttribute( i ) ) |
|
697 |
*(specAttribVals + i) = *( aAttribList + i_spec_attrib ); |
|
698 |
} |
|
699 |
i_spec_attrib += 2; |
|
700 |
} |
|
701 |
||
702 |
//Go through the configurations |
|
703 |
for( TInt i_config = 0;i_config < configcnt; ++i_config ) |
|
704 |
{ |
|
705 |
TBool pass = ETrue;//true, unless we bump into an attribute that doesn't match |
|
706 |
//Go throught the attributes of this configuration |
|
707 |
for( TInt i_attr = 0; i_attr < attribs_per_config; ++i_attr ) |
|
708 |
{ |
|
709 |
EGL_TRACE( "cnf %d, attr %d = %d ", i_config, i_attr, *( sgConfigAttribs + i_config*attribs_per_config + i_attr ) ); |
|
710 |
//Match attribute values here, if the client-specified attribute value isn't empty |
|
711 |
if( *( specAttribVals + i_attr ) != -1 ) |
|
712 |
{ |
|
713 |
switch( EglRFC::MetaGetConfigAttributeSelCriteria( i_attr ) ) |
|
714 |
{ |
|
715 |
case EExact: |
|
716 |
{ |
|
717 |
if( *( specAttribVals + i_attr ) != *( sgConfigAttribs + i_config*attribs_per_config + i_attr ) ) |
|
718 |
{ |
|
719 |
pass = EFalse; |
|
720 |
} |
|
721 |
break; |
|
722 |
} |
|
723 |
case EAtLeast: |
|
724 |
{ |
|
725 |
if( *( specAttribVals + i_attr ) > *( sgConfigAttribs + i_config*attribs_per_config + i_attr ) ) |
|
726 |
{ |
|
727 |
pass = EFalse; |
|
728 |
} |
|
729 |
break; |
|
730 |
} |
|
731 |
case EMask: |
|
732 |
{ |
|
733 |
if( !(*( specAttribVals + i_attr ) & *( sgConfigAttribs + i_config*attribs_per_config + i_attr )) ) |
|
734 |
{ |
|
735 |
pass = EFalse; |
|
736 |
} |
|
737 |
break; |
|
738 |
} |
|
739 |
}//switch comparison method |
|
740 |
||
741 |
}//if attribute value specified by client |
|
742 |
}//for through the attributes of a configuration |
|
743 |
if( pass ) |
|
744 |
{ |
|
745 |
*(sgConfigsMatchingAttributes + i_config) = ETrue; |
|
746 |
} |
|
747 |
else |
|
748 |
{ |
|
749 |
*(sgConfigsMatchingAttributes + i_config) = EFalse; |
|
750 |
} |
|
751 |
}//end for through the configurations |
|
752 |
||
753 |
//Now get the configs that match, and return those |
|
754 |
TInt aConfigsIndex = 0; |
|
755 |
for( TInt i_config = 0;i_config < configcnt; ++i_config ) |
|
756 |
{ |
|
757 |
if( *(sgConfigsMatchingAttributes + i_config) ) |
|
758 |
{ |
|
759 |
if( aConfigsIndex < aConfigSize ) |
|
760 |
{ |
|
761 |
*(aConfigs + (aConfigsIndex++)) = *(sgConfigs + i_config); |
|
762 |
++sgConfigsMatchingAttributesCnt; |
|
763 |
} |
|
764 |
} |
|
765 |
} |
|
766 |
//Ok, all done. Delete allocated memory |
|
767 |
// ToDo use correct Heap! |
|
768 |
delete[] sgConfigs; |
|
769 |
delete[] sgConfigsMatchingAttributes; |
|
770 |
delete[] sgConfigAttribs; |
|
771 |
delete[] specAttribVals; |
|
772 |
return EGL_TRUE; |
|
773 |
} |
|
774 |
#endif |
|
775 |
||
776 |
EGLint CGuestEGL::ChooseConfigAttribsForFbsBitmap(TEglThreadState& aThreadState, const EGLint* aAttribList, const CFbsBitmap* aBitmap, EGLint** aNewList) |
|
777 |
{ |
|
778 |
EGLPANIC_ASSERT_DEBUG(aNewList, EEglPanicTemp); |
|
779 |
EGLint error = EGL_SUCCESS; |
|
780 |
const TInt listLength = TAttribUtils::AttribListLength(aAttribList); |
|
781 |
ASSERT(listLength); |
|
782 |
TDisplayMode mode = ENone; |
|
783 |
const EGLint* pRenderType = TAttribUtils::FindAttribValue(aAttribList, EGL_RENDERABLE_TYPE); |
|
784 |
||
785 |
mode = aBitmap->DisplayMode(); |
|
786 |
EGL_TRACE("CGuestEGL::ChooseConfigAttribsForFbsBitmap bitmap addr=0x%x, Display Mode=%d", aBitmap, mode); |
|
787 |
switch (mode) |
|
788 |
{ |
|
789 |
case EColor64K: |
|
790 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 5, 6, 5); |
|
791 |
break; |
|
792 |
case EColor16M: |
|
793 |
case EColor16MU: |
|
794 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 8, 8, 8); |
|
795 |
break; |
|
796 |
case EColor16MA: |
|
797 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
798 |
break; |
|
799 |
case EColor16MAP: |
|
800 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
801 |
break; |
|
802 |
default: // pixmap not supported |
|
803 |
error = EGL_BAD_NATIVE_PIXMAP; |
|
804 |
break; |
|
805 |
} |
|
806 |
||
807 |
if (error != EGL_SUCCESS) |
|
808 |
{ |
|
809 |
return error; |
|
810 |
} |
|
811 |
||
812 |
const TInt KExpansionSpace = 10 * 2; // want enough space for 10 extra attribute/value pairs |
|
813 |
*aNewList = (EGLint*) CVghwUtils::Alloc( (listLength + KExpansionSpace) * sizeof(EGLint) ); |
|
814 |
if (!*aNewList) |
|
815 |
{ |
|
816 |
return EGL_BAD_ALLOC; |
|
817 |
} |
|
818 |
memcpy(*aNewList, aAttribList, listLength * sizeof(EGLint)); |
|
819 |
||
820 |
switch (mode) |
|
821 |
{ |
|
822 |
case EColor64K: |
|
823 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 5, 6, 5); |
|
824 |
break; |
|
825 |
case EColor16M: |
|
826 |
case EColor16MU: |
|
827 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8); |
|
828 |
break; |
|
829 |
case EColor16MA: |
|
830 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
831 |
break; |
|
832 |
case EColor16MAP: |
|
833 |
if (pRenderType && ( (*pRenderType) & EGL_OPENVG_BIT) ) |
|
834 |
{ |
|
835 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8, ETrue); |
|
836 |
} |
|
837 |
else |
|
838 |
{ |
|
839 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
840 |
} |
|
841 |
break; |
|
842 |
default: |
|
843 |
EGLPANIC_ALWAYS(EEglPanicTemp); |
|
844 |
} |
|
845 |
||
846 |
return EGL_SUCCESS; |
|
847 |
} |
|
848 |
||
849 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
850 |
EGLint CGuestEGL::ChooseConfigAttribsForSgImage(TEglThreadState& aThreadState, const EGLint* aAttribList, const RSgImage* aSgImage, EGLint** aNewList) |
|
851 |
{ |
|
852 |
ASSERT(aNewList); |
|
853 |
EGLint error = EGL_SUCCESS; |
|
854 |
const TInt listLength = TAttribUtils::AttribListLength(aAttribList); |
|
855 |
ASSERT(listLength); |
|
856 |
const EGLint* pRenderType = TAttribUtils::FindAttribValue(aAttribList, EGL_RENDERABLE_TYPE); |
|
857 |
||
858 |
/* |
|
859 |
if (!iSgConfigAttribs) |
|
860 |
{ |
|
861 |
EGL_TRACE( "CGuestEGL::ChooseConfigAttribsForSgImage 1. EglInternalFunction_MetaGetConfigs" ); |
|
862 |
EGLConfig* config; |
|
863 |
EGLint config_cnt; |
|
864 |
EglInternalFunction_MetaGetConfigs(aThreadState, config, config_cnt, iSgConfigAttribs, iSgConfigsAttribtCnt); |
|
865 |
EGL_TRACE( "EglInternalFunction_MetaGetConfigs cnt = %d ", iSgConfigsAttribtCnt ); |
|
866 |
} |
|
867 |
if (!iSgConfigAttribs) |
|
868 |
{ // exit if EglInternalFunction_MetaGetConfigs still failed |
|
869 |
return EGL_BAD_ALLOC; |
|
870 |
} |
|
871 |
*/ |
|
872 |
// ToDo use iSgConfigAttribs |
|
873 |
||
874 |
// temporarily open a handle to the SgImage |
|
875 |
TSgDrawableId sgId = aSgImage->Id(); |
|
876 |
RSgDrawable sgHandle; |
|
877 |
TSgImageInfo imgInfo; |
|
878 |
EGL_TRACE("CGuestEGL::ChooseConfigAttribsForSgImage 1. SgImage Id=0x%lx", sgId); |
|
879 |
||
880 |
// ToDo check SgImage usage bits |
|
881 |
if ( (sgId != KSgNullDrawableId) && (KErrNone == sgHandle.Open(sgId)) && (KErrNone == aSgImage->GetInfo(imgInfo)) ) |
|
882 |
{ |
|
883 |
EGL_TRACE("CGuestEGL::ChooseConfigAttribsForSgImage 2. SgImage PixelFormat=0x%x; size=%d,%d; Usage=0x%x", |
|
884 |
imgInfo.iPixelFormat, imgInfo.iSizeInPixels.iWidth, imgInfo.iSizeInPixels.iHeight, imgInfo.iUsage); |
|
885 |
||
886 |
switch (imgInfo.iPixelFormat) |
|
887 |
{ |
|
888 |
case ESgPixelFormatARGB_8888_PRE: // == EUidPixelFormatARGB_8888_PRE |
|
889 |
case ESgPixelFormatARGB_8888: // == EUidPixelFormatARGB_8888, |
|
890 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
891 |
break; |
|
892 |
case ESgPixelFormatXRGB_8888: // == EUidPixelFormatXRGB_8888, |
|
893 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 8, 8, 8); |
|
894 |
break; |
|
895 |
case ESgPixelFormatRGB_565: // == EUidPixelFormatRGB_565, |
|
896 |
error = CheckColorAttributes(aAttribList, EGL_RGB_BUFFER, 0, 5, 6, 5); |
|
897 |
break; |
|
898 |
case ESgPixelFormatA_8: // == EUidPixelFormatA_8 |
|
899 |
error = CheckColorAttributes(aAttribList, EGL_LUMINANCE_BUFFER, 8, 0, 0, 0); |
|
900 |
break; |
|
901 |
default: // pixmap not supported |
|
902 |
error = EGL_BAD_NATIVE_PIXMAP; |
|
903 |
break; |
|
904 |
} |
|
905 |
} |
|
906 |
else |
|
907 |
{ |
|
908 |
error = EGL_BAD_PARAMETER; |
|
909 |
} |
|
910 |
sgHandle.Close(); |
|
911 |
||
912 |
||
913 |
if (error != EGL_SUCCESS) |
|
914 |
{ |
|
915 |
return error; |
|
916 |
} |
|
917 |
||
918 |
const TInt KExpansionSpace = 10 * 2; // want enough space for 10 extra attribute/value pairs |
|
919 |
*aNewList = (EGLint*) CVghwUtils::Alloc( (listLength + KExpansionSpace) * sizeof(EGLint) ); |
|
920 |
if (!*aNewList) |
|
921 |
{ |
|
922 |
return EGL_BAD_ALLOC; |
|
923 |
} |
|
924 |
memcpy(*aNewList, aAttribList, listLength * sizeof(EGLint)); |
|
925 |
||
926 |
switch (imgInfo.iPixelFormat) |
|
927 |
{ |
|
928 |
case ESgPixelFormatARGB_8888_PRE: // == EUidPixelFormatARGB_8888_PRE |
|
929 |
if (pRenderType && ( (*pRenderType) & EGL_OPENVG_BIT) ) |
|
930 |
{ |
|
931 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8, ETrue); |
|
932 |
} |
|
933 |
else |
|
934 |
{ |
|
935 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
936 |
} |
|
937 |
break; |
|
938 |
case ESgPixelFormatARGB_8888: // == EUidPixelFormatARGB_8888, |
|
939 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8, 8); |
|
940 |
break; |
|
941 |
case ESgPixelFormatXRGB_8888: // == EUidPixelFormatXRGB_8888, |
|
942 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 8, 8, 8); |
|
943 |
break; |
|
944 |
case ESgPixelFormatRGB_565: // == EUidPixelFormatRGB_565, |
|
945 |
AppendColorAttributes(*aNewList, EGL_RGB_BUFFER, 0, 5, 6, 5); |
|
946 |
break; |
|
947 |
case ESgPixelFormatA_8: // == EUidPixelFormatA_8 |
|
948 |
AppendColorAttributes(*aNewList, EGL_LUMINANCE_BUFFER, 8, 0, 0, 0); |
|
949 |
break; |
|
950 |
default: // pixmap not supported - panic because this code should be in-sync with supported SgImage formats |
|
951 |
EGLPANIC_ALWAYS(EEglPanicTemp); |
|
952 |
break; |
|
953 |
} |
|
954 |
||
955 |
// change requested surface type from pixmap to Pbuffer |
|
956 |
EGLint* pSurfaceType = TAttribUtils::FindAttribValue(*aNewList, EGL_SURFACE_TYPE); |
|
957 |
EGLint surfaceType = *pSurfaceType; |
|
958 |
*pSurfaceType = EGL_PBUFFER_BIT | (surfaceType & ~EGL_PIXMAP_BIT); |
|
959 |
||
960 |
TAttribUtils::RemoveAttrib(*aNewList, EGL_MATCH_NATIVE_PIXMAP); |
|
961 |
return EGL_SUCCESS; |
|
962 |
} |
|
963 |
#endif |
|
964 |
||
965 |
/* |
|
966 |
Create an information object for an opened Display. |
|
967 |
*/ |
|
968 |
TBool CGuestEGL::CreateDisplayInfo(EGLDisplay aDisplay) |
|
969 |
{ |
|
970 |
TBool result = EFalse; |
|
971 |
EGL_TRACE("CGuestEGL::CreateDisplayInfo begin aDisplay=%d", aDisplay); |
|
972 |
iDisplayMapLock.WriteLock(); |
|
973 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
974 |
if (NULL != iDisplayMap.Find( aDisplay)) |
|
975 |
{ |
|
976 |
result = ETrue; |
|
977 |
} |
|
978 |
else |
|
979 |
{ |
|
980 |
TInt err = KErrNoMemory; |
|
981 |
CEglDisplayInfo* dispInfo = new CEglDisplayInfo; |
|
982 |
||
983 |
if (dispInfo) |
|
984 |
{ |
|
985 |
err = iDisplayMap.Insert(aDisplay, dispInfo); |
|
986 |
// EGL_TRACE("CreateDisplayInfo - DisplayMap insert error %d", err); |
|
987 |
EGLPANIC_ASSERT_DEBUG(err == KErrNone, EEglPanicDisplayMapInsertFailed); |
|
988 |
||
989 |
//added for egl sync extension benefit |
|
990 |
if (iEglSyncExtension) |
|
991 |
{ |
|
992 |
err = iEglSyncExtension->EglSyncDisplayCreate(aDisplay); |
|
993 |
// EGL_TRACE("CreateDisplayInfo - EglSyncDisplayCreate error %d", err); |
|
994 |
EGLPANIC_ASSERT_DEBUG(err == KErrNone, EEglPanicEglSyncDisplayCreateFailed); |
|
995 |
||
996 |
if (err) |
|
997 |
{ |
|
998 |
iDisplayMap.Remove(aDisplay); |
|
999 |
} |
|
1000 |
} |
|
1001 |
} |
|
1002 |
||
1003 |
if (err == KErrNone) |
|
1004 |
{ |
|
1005 |
result = ETrue; |
|
1006 |
} |
|
1007 |
} |
|
1008 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
1009 |
iDisplayMapLock.Unlock(); |
|
1010 |
||
1011 |
EGL_TRACE("CreateDisplayInfo end, result=%d", result); |
|
1012 |
return result; |
|
1013 |
} |
|
1014 |
||
1015 |
/* |
|
1016 |
Mark information object for Display as Initialised |
|
1017 |
*/ |
|
1018 |
TBool CGuestEGL::InitializeDisplayInfo(EGLDisplay aDisplay) |
|
1019 |
{ |
|
1020 |
TBool result = EFalse; |
|
1021 |
EGL_TRACE("CGuestEGL::InitialiseDisplayInfo begin aDisplay=%d", aDisplay); |
|
1022 |
iDisplayMapLock.WriteLock(); |
|
1023 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
1024 |
if (pDispInfo && *pDispInfo) |
|
1025 |
{ |
|
1026 |
(*pDispInfo)->iInitialized = ETrue; |
|
1027 |
result = ETrue; |
|
1028 |
} |
|
1029 |
iDisplayMapLock.Unlock(); |
|
1030 |
||
1031 |
EGL_TRACE("InitialiseDisplayInfo end, result=%d", result); |
|
1032 |
return result; |
|
1033 |
} |
|
1034 |
||
1035 |
/* |
|
1036 |
Check whether Display exists and is Initialised |
|
1037 |
*/ |
|
1038 |
TBool CGuestEGL::IsDisplayInitialized(EGLDisplay aDisplay) |
|
1039 |
{ |
|
1040 |
TBool result = EFalse; |
|
1041 |
EGL_TRACE("CGuestEGL::IsDisplayInitialized begin aDisplay=%d", aDisplay); |
|
1042 |
iDisplayMapLock.ReadLock(); |
|
1043 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
1044 |
if ( pDispInfo && *pDispInfo && (*pDispInfo)->iInitialized) |
|
1045 |
{ |
|
1046 |
result = ETrue; |
|
1047 |
} |
|
1048 |
iDisplayMapLock.Unlock(); |
|
1049 |
||
1050 |
EGL_TRACE("IsDisplayInitialized end, result=%d", result); |
|
1051 |
return result; |
|
1052 |
} |
|
1053 |
||
1054 |
EGLBoolean CGuestEGL::eglSwapBuffers(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface) |
|
1055 |
{ |
|
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1056 |
/** |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1057 |
* PSEUDO CODE |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1058 |
* serialization.eglSwapBuffers |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1059 |
* (maybe finish currently bound api) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1060 |
* surfaceupdatesession.notifywhenavailable |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1061 |
* .whendisplayed() (alternative choice from above) |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1062 |
* surfaceupdatesession.submitupdated() |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1063 |
* user:waitforrequestl |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1064 |
*/ |
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1065 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1066 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
13 | 1067 |
TSurfaceInfo* surfaceInfo = EglInternalFunction_GetPlatformSurface( aDisplay, aSurface ); |
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1068 |
RemoteFunctionCallData rfcdata; |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1069 |
EglRFC eglApiData( rfcdata ); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1070 |
eglApiData.Init(EglRFC::EeglSwapBuffers); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1071 |
TSize size = surfaceInfo->iNativeWindow->Size(); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1072 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1073 |
eglApiData.AppendEGLDisplay(aDisplay); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1074 |
eglApiData.AppendEGLSurface(surfaceInfo->iHostSurfaceId); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1075 |
eglApiData.AppendEGLint(size.iWidth); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1076 |
eglApiData.AppendEGLint(size.iHeight); |
13 | 1077 |
|
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1078 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1079 |
TRequestStatus status; |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1080 |
TTimeStamp timestampLocalToThread; |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1081 |
surfaceInfo->iSurfaceUpdateSession.NotifyWhenDisplayed(status, timestampLocalToThread); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1082 |
surfaceInfo->iSurfaceUpdateSession.SubmitUpdate(surfaceInfo->iNativeWindow->ScreenNumber(),surfaceInfo->iSurfaceId, surfaceInfo->iFrontBuffer); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1083 |
User::WaitForRequest(status); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1084 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1085 |
if (surfaceInfo->iFrontBuffer == 0) |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1086 |
{ |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1087 |
surfaceInfo->iFrontBuffer = 1; |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1088 |
} |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1089 |
else |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1090 |
{ |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1091 |
surfaceInfo->iFrontBuffer = 0; |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1092 |
} |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1093 |
|
13 | 1094 |
if (size != surfaceInfo->iSize) |
1095 |
{ |
|
1096 |
EGL_TRACE("CGuestEGL::eglSwapBuffers Surface Resized size=%d,%d, surfaceInfo->iSize=%d,%d", |
|
1097 |
size.iHeight, size.iWidth, surfaceInfo->iSize.iHeight, surfaceInfo->iSize.iWidth); |
|
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1098 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1099 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1100 |
return EglInternalFunction_SurfaceResized(aThreadState, *surfaceInfo, aDisplay, aSurface); // TODO handling of resize |
13 | 1101 |
} |
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1102 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1103 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1104 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1105 |
return result; |
13 | 1106 |
} |
1107 |
||
1108 |
EGLBoolean CGuestEGL::eglMakeCurrent(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aDraw, EGLSurface aRead, EGLContext aContext) |
|
1109 |
{ |
|
1110 |
if (aContext == EGL_NO_CONTEXT) |
|
1111 |
{ |
|
1112 |
if ( (aDraw != EGL_NO_SURFACE) || (aRead != EGL_NO_SURFACE) ) |
|
1113 |
{ |
|
1114 |
aThreadState.SetEglError(EGL_BAD_SURFACE); |
|
1115 |
return EGL_FALSE; |
|
1116 |
} |
|
1117 |
EGL_TRACE("CGuestEGL::eglMakeCurrent call host"); |
|
1118 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1119 |
eglApiData.Init( EglRFC::EeglMakeCurrent ); |
|
61
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1120 |
eglApiData.AppendEGLDisplay(EGL_NO_DISPLAY); |
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1121 |
eglApiData.AppendEGLSurface(EGL_NO_SURFACE); |
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1122 |
eglApiData.AppendEGLSurface(EGL_NO_SURFACE); |
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1123 |
eglApiData.AppendEGLContext(EGL_NO_CONTEXT); |
13 | 1124 |
|
1125 |
EGLBoolean ret = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
1126 |
EGL_TRACE("CGuestEGL::eglMakeCurrent end success=%d", ret); |
|
1127 |
return (EGLBoolean)ret; |
|
1128 |
} |
|
1129 |
else |
|
1130 |
{ |
|
1131 |
if ( (aDraw == EGL_NO_SURFACE) || (aRead == EGL_NO_SURFACE) ) |
|
1132 |
{ |
|
1133 |
aThreadState.SetEglError(EGL_BAD_SURFACE); |
|
1134 |
return EGL_FALSE; |
|
1135 |
} |
|
1136 |
// ToDo use new CEglContext code |
|
1137 |
const TInt KMaxSurfaces( 2 ); |
|
1138 |
EGLSurface surfaces[KMaxSurfaces]; |
|
1139 |
TSurfaceInfo* surfaceInfo[KMaxSurfaces] = {NULL, NULL}; |
|
1140 |
surfaces[0] = aDraw; |
|
1141 |
if (aDraw != aRead) |
|
1142 |
{ |
|
1143 |
surfaces[1] = aRead; |
|
1144 |
} |
|
1145 |
else |
|
1146 |
{ |
|
1147 |
surfaces[1] = EGL_NO_SURFACE; |
|
1148 |
} |
|
1149 |
||
1150 |
for ( TInt i = 0; i < KMaxSurfaces; i++ ) |
|
1151 |
{ |
|
1152 |
if ( EGL_NO_SURFACE != surfaces[i] ) |
|
1153 |
{ |
|
1154 |
EGL_TRACE("CGuestEGL::eglMakeCurrent check surface %d", surfaces[i] ); |
|
1155 |
surfaceInfo[i] = EglInternalFunction_GetPlatformSurface( aDisplay, surfaces[i] ); |
|
61
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1156 |
EGL_TRACE("CGuestEGL::eglMakeCurrent surfaces[%d] is %x", i, surfaces[i]); |
13 | 1157 |
//EGL_CHECK_ERROR( surfaceInfo, EGL_BAD_SURFACE , EGL_FALSE ); |
1158 |
if ( surfaceInfo[i] ) |
|
1159 |
{ |
|
1160 |
TSize newSize; |
|
1161 |
switch (surfaceInfo[i]->iSurfaceType) |
|
1162 |
{ |
|
1163 |
case ESurfaceTypePixmapFbsBitmap: |
|
1164 |
EGLPANIC_ASSERT_DEBUG(surfaceInfo[i]->iFbsBitmap, EEglPanicTemp); |
|
1165 |
newSize = surfaceInfo[i]->iFbsBitmap->SizeInPixels(); |
|
1166 |
break; |
|
1167 |
case ESurfaceTypeWindow: |
|
1168 |
EGLPANIC_ASSERT_DEBUG(surfaceInfo[i]->iNativeWindow, EEglPanicTemp); |
|
1169 |
newSize = surfaceInfo[i]->iNativeWindow->Size(); |
|
1170 |
break; |
|
1171 |
default: |
|
1172 |
// size cannot change for other surface types |
|
1173 |
newSize = surfaceInfo[i]->iSize; |
|
1174 |
break; |
|
1175 |
} |
|
1176 |
if (newSize != surfaceInfo[i]->iSize) |
|
1177 |
{ |
|
1178 |
EGL_TRACE("CGuestEGL::eglMakeCurrent resize surface"); |
|
1179 |
if ( !EglInternalFunction_SurfaceResized(aThreadState, *surfaceInfo[i], aDisplay, surfaces[i] ) ) |
|
1180 |
{ |
|
1181 |
return EGL_FALSE; |
|
1182 |
} |
|
1183 |
surfaceInfo[i]->iSize = newSize; |
|
1184 |
} |
|
1185 |
} |
|
1186 |
} |
|
1187 |
} |
|
1188 |
||
1189 |
// adapt to only some surfaces having CEglSurfaceInfo objects so far |
|
1190 |
EGLSurface drawId = surfaceInfo[0] ? surfaceInfo[0]->iHostSurfaceId : aDraw; |
|
1191 |
EGLSurface readId = aRead; |
|
1192 |
if ((aRead == aDraw) && surfaceInfo[0]) |
|
1193 |
{ |
|
1194 |
readId = surfaceInfo[0]->iHostSurfaceId; |
|
1195 |
} |
|
1196 |
else if (surfaceInfo[1]) |
|
1197 |
{ |
|
1198 |
readId = surfaceInfo[1]->iHostSurfaceId; |
|
1199 |
} |
|
1200 |
||
1201 |
EGL_TRACE(" eglMakeCurrent surfaces[0]=0x%x, surfaces[1]=0x%x", surfaces[0], surfaces[1]); |
|
1202 |
EGL_TRACE(" eglMakeCurrent surfacesInfo[0]=0x%x, surfacesInfo[0].iHostSurfaceId=0x%x", |
|
1203 |
surfaceInfo[0], surfaceInfo[0] ? surfaceInfo[0]->iHostSurfaceId : NULL); |
|
1204 |
EGL_TRACE(" eglMakeCurrent surfacesInfo[1]=0x%x, surfacesInfo[1].iHostSurfaceId=0x%x", |
|
1205 |
surfaceInfo[1], surfaceInfo[1] ? surfaceInfo[1]->iHostSurfaceId : NULL); |
|
1206 |
||
1207 |
EGL_TRACE("CGuestEGL::eglMakeCurrent call host"); |
|
1208 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1209 |
eglApiData.Init( EglRFC::EeglMakeCurrent ); |
|
1210 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1211 |
||
1212 |
EGL_TRACE(" eglApiData.AppendEGLSurface(drawId = 0x%x)", drawId); |
|
1213 |
eglApiData.AppendEGLSurface(drawId); |
|
1214 |
EGL_TRACE(" eglApiData.AppendEGLSurface(readId = 0x%x);", readId); |
|
1215 |
eglApiData.AppendEGLSurface(readId); |
|
1216 |
||
1217 |
eglApiData.AppendEGLContext(aContext); |
|
1218 |
EGLBoolean ret = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
61
032a79db4ef1
Revert fix for eglMakeCurrent since it was the deinit path was is ok for EGL_NO_*. Add extra debugging
Faisal Memon <faisal.memon@nokia.com>
parents:
60
diff
changeset
|
1219 |
EGL_TRACE("CGuestEGL::eglMakeCurrent last end success=%d", ret); |
13 | 1220 |
return (EGLBoolean)ret; |
1221 |
} |
|
1222 |
} |
|
1223 |
||
1224 |
// FAISALMEMON HOLE 0.1 |
|
1225 |
||
1226 |
||
1227 |
// ----------------------------------------------------------------------------- |
|
1228 |
// |
|
1229 |
// ----------------------------------------------------------------------------- |
|
1230 |
// |
|
1231 |
TBool CGuestEGL::EglInternalFunction_CreateSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLConfig aConfig, RWindow* aNativeWindow, |
|
1232 |
TSurfaceInfo& aSurfaceInfo) |
|
1233 |
{ |
|
1234 |
RSurfaceManager::TSurfaceCreationAttributesBuf attributes; |
|
1235 |
RSurfaceManager::TInfoBuf info; |
|
63
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1236 |
TInt r; |
13 | 1237 |
|
1238 |
aSurfaceInfo.iNativeWindow = aNativeWindow; |
|
1239 |
aSurfaceInfo.iSurfaceType = ESurfaceTypeWindow; |
|
1240 |
aSurfaceInfo.iSize = aNativeWindow->Size(); |
|
1241 |
aSurfaceInfo.iConfigId = aConfig; |
|
1242 |
aSurfaceInfo.iHostSurfaceId = aSurface; |
|
1243 |
||
1244 |
// ToDo have function variants that do not validate parameters |
|
1245 |
eglQuerySurface(aThreadState, aDisplay, aSurface, EGL_VG_ALPHA_FORMAT, &aSurfaceInfo.iAlphaFormat); |
|
1246 |
eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_BUFFER_SIZE, &aSurfaceInfo.iColorBits); |
|
1247 |
eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_RED_SIZE, &aSurfaceInfo.iRedBits); |
|
1248 |
eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_GREEN_SIZE, &aSurfaceInfo.iGreenBits); |
|
1249 |
eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_BLUE_SIZE, &aSurfaceInfo.iBlueBits); |
|
1250 |
eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_ALPHA_SIZE, &aSurfaceInfo.iAlphaBits); |
|
1251 |
||
1252 |
/* |
|
1253 |
TInt err = LastError(); |
|
1254 |
EGL_CHECK_ERROR( EGL_SUCCESS == err, err, EGL_FALSE ); |
|
1255 |
*/ |
|
1256 |
EGL_TRACE(" Win surface details: width=%d height=%d colorbits=%d red=%d green=%d blue=%d alpha=%d alphaformat=0x%x", |
|
1257 |
aSurfaceInfo.iSize.iWidth, aSurfaceInfo.iSize.iHeight, aSurfaceInfo.iColorBits, aSurfaceInfo.iRedBits, |
|
1258 |
aSurfaceInfo.iGreenBits, aSurfaceInfo.iBlueBits, aSurfaceInfo.iAlphaBits, aSurfaceInfo.iAlphaFormat); |
|
1259 |
||
1260 |
TSize size; |
|
1261 |
||
1262 |
// FAISALMEMON HOLE 1 |
|
1263 |
||
1264 |
// FAISALMEMON STUB CODE |
|
63
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1265 |
|
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1266 |
TInt offsetToFirstBuffer = -1; |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1267 |
TInt offsetToSecondBuffer = -1; |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1268 |
r = aSurfaceInfo.iSurfaceManager.GetBufferOffset(aSurfaceInfo.iSurfaceId,0,offsetToFirstBuffer); |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1269 |
if(r!=KErrNone) |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1270 |
return EGL_FALSE; |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1271 |
r = aSurfaceInfo.iSurfaceManager.GetBufferOffset(aSurfaceInfo.iSurfaceId,1,offsetToSecondBuffer); |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1272 |
if(r!=KErrNone) |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1273 |
return EGL_FALSE; |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1274 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface offsetToFirstBuffer=0x%x offsetToSecondBuffer=0x%x",offsetToFirstBuffer,offsetToSecondBuffer); |
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1275 |
|
13f031032ff1
Update CGuestEGL::eglCreateWindowSurface to save iSurfaceId and get offesets to buffers that lower layers require
Jon Medhurst
parents:
61
diff
changeset
|
1276 |
// FAISALMEMON END OF STUB CODE |
13 | 1277 |
|
1278 |
TUint32 chunkHWBase = 0; |
|
59
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
1279 |
TInt err = CVghwUtils::MapToHWAddress(aSurfaceInfo.iChunk.Handle(), chunkHWBase); |
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
1280 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface MapToHWAddress returned %d", err); |
13 | 1281 |
// FAISALMEMON write code to handle errors in the above function |
1282 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface AFTER VGHWUtils::MapToHWAddress"); |
|
1283 |
||
31
e77cac87b397
Merge rename of frame buffer to surface buffer with Guest EGL changes.
Matt Plumtree <matt.plumtree@nokia.com>
diff
changeset
|
1284 |
TUint32 surfaceBufferBaseAddress(0); |
32
b23067389fdf
Fixup missed changes from frame (buffer) to surface buffer.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
31
diff
changeset
|
1285 |
(void)CVghwUtils::GetSurfaceBufferBaseAddress(surfaceBufferBaseAddress); |
59
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
1286 |
EGL_TRACE("CGuestEGL::egliCreateSurface AFTER VGHWUtils::MapToHWAddress"); |
d9b81aebba7b
Add mapping fix to guestegl and debugging (temporary)
Faisal Memon <faisal.memon@nokia.com>
parents:
50
diff
changeset
|
1287 |
EGL_TRACE("CGuestEGL::egliCreateSurface aSurfaceInfo.iChunk.Base() is %x", aSurfaceInfo.iChunk.Base()); |
13 | 1288 |
/* Store the pointer to the pixel data */ |
39
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1289 |
aSurfaceInfo.iBuffer0 = aSurfaceInfo.iChunk.Base() + offsetToFirstBuffer; |
c8311e991ee3
interim checkin, no compilation check done so don't sync to this changeset
Faisal Memon <faisal.memon@nokia.com>
parents:
28
diff
changeset
|
1290 |
aSurfaceInfo.iBuffer1 = aSurfaceInfo.iChunk.Base() + offsetToSecondBuffer; |
13 | 1291 |
|
31
e77cac87b397
Merge rename of frame buffer to surface buffer with Guest EGL changes.
Matt Plumtree <matt.plumtree@nokia.com>
diff
changeset
|
1292 |
aSurfaceInfo.iBuffer0Index = (chunkHWBase + offsetToFirstBuffer) - surfaceBufferBaseAddress; |
e77cac87b397
Merge rename of frame buffer to surface buffer with Guest EGL changes.
Matt Plumtree <matt.plumtree@nokia.com>
diff
changeset
|
1293 |
aSurfaceInfo.iBuffer1Index = (chunkHWBase + offsetToSecondBuffer) - surfaceBufferBaseAddress; |
40
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1294 |
|
eaa1315a8556
added eglSwapBuffers integration; this change has not been compiled so don't sync to this changelist
Faisal Memon <faisal.memon@nokia.com>
parents:
39
diff
changeset
|
1295 |
aSurfaceInfo.iFrontBuffer = 0; // Assume host peer also starts rendering buffer 0 as its front buffer |
13 | 1296 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface %u %x %x %x %x",chunkHWBase, offsetToFirstBuffer, offsetToSecondBuffer, |
1297 |
aSurfaceInfo.iBuffer0Index, |
|
1298 |
aSurfaceInfo.iBuffer1Index); |
|
1299 |
||
1300 |
if ( !EglInternalFunction_CallSetSurfaceParams(aThreadState, aDisplay, aSurface, aSurfaceInfo) ) |
|
1301 |
{ |
|
1302 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface end failure"); |
|
1303 |
||
1304 |
return EGL_FALSE; |
|
1305 |
} |
|
1306 |
EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface end success"); |
|
1307 |
||
1308 |
return EGL_TRUE; |
|
1309 |
} |
|
1310 |
||
1311 |
// ----------------------------------------------------------------------------- |
|
1312 |
// |
|
1313 |
// ----------------------------------------------------------------------------- |
|
1314 |
// |
|
1315 |
EGLBoolean CGuestEGL::eglDestroySurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface) |
|
1316 |
{ |
|
1317 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1318 |
EGLBoolean result = EGL_FALSE; |
|
1319 |
||
1320 |
// do not destroy SgImage surfaces on the Host! |
|
1321 |
TSurfaceInfo* surfaceInfo = EglInternalFunction_GetPlatformSurface(aDisplay, aSurface); |
|
1322 |
if (!surfaceInfo) |
|
1323 |
{ // Note: Pbuffer surfaces are not currently recorded in client |
|
1324 |
eglApiData.Init( EglRFC::EeglDestroySurface ); |
|
1325 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1326 |
eglApiData.AppendEGLSurface(aSurface); |
|
1327 |
result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
1328 |
} |
|
1329 |
else |
|
1330 |
{ |
|
1331 |
if (surfaceInfo->iSurfaceType != ESurfaceTypePixmapSgImage) |
|
1332 |
{ // destroy surface allocated by Host EGL |
|
1333 |
eglApiData.Init( EglRFC::EeglDestroySurface ); |
|
1334 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1335 |
eglApiData.AppendEGLSurface(surfaceInfo->iHostSurfaceId); |
|
1336 |
result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
1337 |
} |
|
1338 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
1339 |
else |
|
1340 |
{ // release SgImage handle |
|
1341 |
surfaceInfo->iSgHandle.Close(); |
|
1342 |
} |
|
1343 |
#endif |
|
1344 |
||
1345 |
DestroySurfaceInfo(aDisplay, aSurface); |
|
1346 |
} |
|
1347 |
||
1348 |
return result; |
|
1349 |
} |
|
1350 |
// ----------------------------------------------------------------------------- |
|
1351 |
// |
|
1352 |
// ----------------------------------------------------------------------------- |
|
1353 |
// |
|
1354 |
void CGuestEGL::DestroySurfaceInfo(EGLDisplay aDisplay, EGLSurface aSurface) |
|
1355 |
{ |
|
1356 |
EGL_TRACE("DestroySurfaceInfo begin"); |
|
1357 |
||
1358 |
iDisplayMapLock.ReadLock(); |
|
1359 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
1360 |
if (!pDispInfo || !*pDispInfo) |
|
1361 |
{ |
|
1362 |
EGL_TRACE("cannot find display %d", aDisplay); |
|
1363 |
} |
|
1364 |
else |
|
1365 |
{ |
|
1366 |
TSurfaceInfo** pSurfaceInfo = (*pDispInfo)->iSurfaceMap.Find(aSurface); |
|
1367 |
if (!pSurfaceInfo) |
|
1368 |
{ |
|
1369 |
EGL_TRACE("cannot find surface %d for display %d", aSurface, aDisplay); |
|
1370 |
} |
|
1371 |
else |
|
1372 |
{ |
|
1373 |
TSurfaceInfo* surfaceInfo = *pSurfaceInfo; |
|
1374 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
1375 |
if (surfaceInfo->iNativeWindow) |
|
1376 |
{ |
|
1377 |
EglInternalFunction_DestroyWindowSurface(*surfaceInfo); |
|
1378 |
} |
|
1379 |
delete surfaceInfo; |
|
1380 |
(*pDispInfo)->iSurfaceMap.Remove( aSurface ); |
|
1381 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
1382 |
EGL_TRACE("DestroySurfaceInfo end"); |
|
1383 |
} |
|
1384 |
} |
|
1385 |
||
1386 |
iDisplayMapLock.Unlock(); |
|
1387 |
} |
|
1388 |
||
1389 |
// ----------------------------------------------------------------------------- |
|
1390 |
// |
|
1391 |
// ----------------------------------------------------------------------------- |
|
1392 |
// |
|
1393 |
TBool CGuestEGL::DestroyDisplayInfo (EGLDisplay aDisplay) |
|
1394 |
{ |
|
1395 |
EGL_TRACE("DestroyDisplayInfo begin aDisplay=%d", aDisplay); |
|
1396 |
TBool success = EFalse; |
|
1397 |
||
1398 |
iDisplayMapLock.WriteLock(); |
|
1399 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
1400 |
if (!pDispInfo || !*pDispInfo) |
|
1401 |
{ |
|
1402 |
EGL_TRACE("cannot find display %d", aDisplay); |
|
1403 |
} |
|
1404 |
else |
|
1405 |
{ |
|
1406 |
success = ETrue; |
|
1407 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
1408 |
RHashMap<TInt, TSurfaceInfo*>::TIter iter((*pDispInfo)->iSurfaceMap); |
|
1409 |
for (;;) |
|
1410 |
{ |
|
1411 |
TSurfaceInfo** pSurfaceInfo = const_cast<TSurfaceInfo**>(iter.NextValue()); |
|
1412 |
if (!pSurfaceInfo) |
|
1413 |
{ |
|
1414 |
break; |
|
1415 |
} |
|
1416 |
||
1417 |
EGL_TRACE("destroying surface %d", *iter.CurrentKey()); |
|
1418 |
||
1419 |
TSurfaceInfo* surfaceInfo = *pSurfaceInfo; |
|
1420 |
if (surfaceInfo->iNativeWindow) |
|
1421 |
{ |
|
1422 |
EglInternalFunction_DestroyWindowSurface(*surfaceInfo); |
|
1423 |
} |
|
1424 |
delete surfaceInfo; |
|
1425 |
} |
|
1426 |
iDisplayMap.Remove(aDisplay); |
|
1427 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
1428 |
||
1429 |
//added for egl sync extension benefit |
|
1430 |
if (iEglSyncExtension) |
|
1431 |
{ |
|
1432 |
iEglSyncExtension->EglSyncDisplayDestroy(aDisplay); |
|
1433 |
} |
|
1434 |
} |
|
1435 |
||
1436 |
iDisplayMapLock.Unlock(); |
|
1437 |
EGL_TRACE("DestroyDisplayInfo end - ret=%d", success); |
|
1438 |
return success; |
|
1439 |
} |
|
1440 |
||
1441 |
||
1442 |
// ----------------------------------------------------------------------------- |
|
1443 |
// |
|
1444 |
// ----------------------------------------------------------------------------- |
|
1445 |
// |
|
1446 |
EGLBoolean CGuestEGL::EglInternalFunction_CallSetSurfaceParams(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, TSurfaceInfo& aSurfaceInfo) |
|
1447 |
{ |
|
1448 |
EGL_TRACE("EglInternalFunction_CallSetSurfaceParams begin"); |
|
1449 |
||
1450 |
RemoteFunctionCallData rfcdata; |
|
1451 |
EglRFC eglApiData( rfcdata ); |
|
1452 |
eglApiData.Init(EglRFC::EeglSimulatorSetSurfaceParams); |
|
1453 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1454 |
eglApiData.AppendEGLSurface( aSurface ); |
|
1455 |
EGLNativeWindowType win = (EGLNativeWindowType)aSurfaceInfo.iNativeWindow->ClientHandle(); |
|
1456 |
eglApiData.AppendEGLNativeWindowType( win ); |
|
1457 |
eglApiData.AppendEGLSize(aSurfaceInfo.iSize); |
|
1458 |
eglApiData.AppendEGLint(aSurfaceInfo.iStride); |
|
1459 |
eglApiData.AppendEGLint(aSurfaceInfo.iBuffer0Index); |
|
1460 |
eglApiData.AppendEGLint(aSurfaceInfo.iBuffer1Index); |
|
1461 |
aThreadState.ExecuteEglNeverErrorCmd(eglApiData); |
|
1462 |
||
1463 |
EGL_TRACE("EglInternalFunction_CallSetSurfaceParams end"); |
|
1464 |
return EGL_TRUE; |
|
1465 |
} |
|
1466 |
||
1467 |
// ----------------------------------------------------------------------------- |
|
1468 |
// |
|
1469 |
// ----------------------------------------------------------------------------- |
|
1470 |
// |
|
1471 |
EGLint CGuestEGL::ConfigMatchesFbsBitmapPixmap(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const EGLint* aAttribList, TDisplayMode aMode) |
|
1472 |
{ |
|
1473 |
// ToDo check EGL_VG_ALPHA_FORMAT ? |
|
1474 |
EGLint colorBits, redBits, greenBits, blueBits, alphaBits; |
|
1475 |
EGLint wantColorBits, wantRedBits, wantGreenBits, wantBlueBits; |
|
1476 |
EGLint wantAlphaBits = 0; |
|
1477 |
switch (aMode) |
|
1478 |
{ |
|
1479 |
case EColor64K: |
|
1480 |
wantColorBits = 12; |
|
1481 |
wantRedBits = 5; |
|
1482 |
wantGreenBits = 6; |
|
1483 |
wantBlueBits = 5; |
|
1484 |
break; |
|
1485 |
case EColor16M: |
|
1486 |
case EColor16MU: |
|
1487 |
wantColorBits = 24; |
|
1488 |
wantRedBits = 8; |
|
1489 |
wantGreenBits = 8; |
|
1490 |
wantBlueBits = 8; |
|
1491 |
break; |
|
1492 |
case EColor16MA: |
|
1493 |
wantColorBits = 32; |
|
1494 |
wantRedBits = 8; |
|
1495 |
wantGreenBits = 8; |
|
1496 |
wantBlueBits = 8; |
|
1497 |
wantAlphaBits = 8; |
|
1498 |
break; |
|
1499 |
case EColor16MAP: |
|
1500 |
wantColorBits = 32; |
|
1501 |
wantRedBits = 8; |
|
1502 |
wantGreenBits = 8; |
|
1503 |
wantBlueBits = 8; |
|
1504 |
wantAlphaBits = 8; |
|
1505 |
break; |
|
1506 |
default: // pixmap format not supported |
|
1507 |
return EGL_BAD_NATIVE_PIXMAP; |
|
1508 |
} |
|
1509 |
||
1510 |
// ToDo version of these functions lighter on parameter checking - maybe use cached values |
|
1511 |
if (!eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_BUFFER_SIZE, &colorBits) || |
|
1512 |
!eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_RED_SIZE, &redBits) || |
|
1513 |
!eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_GREEN_SIZE, &greenBits) || |
|
1514 |
!eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_BLUE_SIZE, &blueBits) || |
|
1515 |
!eglGetConfigAttrib(aThreadState, aDisplay, aConfig, EGL_ALPHA_SIZE, &alphaBits) ) |
|
1516 |
{ // fetch failed |
|
1517 |
return EGL_BAD_MATCH; |
|
1518 |
} |
|
1519 |
||
1520 |
EGL_TRACE("CGuestEGL::ConfigMatchesFbsBitmapPixmap: want %d bpp, %d red, %d green, %d blue, %d alpha\n\tconfig has %d bpp, %d red, %d green, %d blue, %d alpha", |
|
1521 |
wantColorBits, wantRedBits, wantGreenBits, wantBlueBits, wantAlphaBits, |
|
1522 |
colorBits, redBits, greenBits, blueBits, alphaBits); |
|
1523 |
||
1524 |
if ( (colorBits < wantColorBits) || (redBits < wantRedBits) || (greenBits < wantGreenBits) || |
|
1525 |
(blueBits < wantBlueBits) || (alphaBits < wantAlphaBits) ) |
|
1526 |
{ // config does not match bitmap |
|
1527 |
return EGL_BAD_MATCH; |
|
1528 |
} |
|
1529 |
||
1530 |
return EGL_SUCCESS; |
|
1531 |
} |
|
1532 |
||
1533 |
/* |
|
1534 |
Returns EGL_NO_SURFACE on failure. If the attributes of pixmap do not |
|
1535 |
correspond to config, then an EGL_BAD_MATCH error is generated. If config does |
|
1536 |
not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not |
|
1537 |
contain EGL_PIXMAP_BIT), an EGL_BAD_MATCH error is generated. If config does |
|
1538 |
not support the colorspace or alpha format attributes specified in attrib list |
|
1539 |
(as defined for eglCreateWindowSurface), an EGL_BAD_MATCH error is generated. |
|
1540 |
If config is not a valid EGLConfig, an EGL_BAD_CONFIG error is generated. If |
|
1541 |
pixmap is not a valid native pixmap handle, then an EGL_BAD_NATIVE_PIXMAP |
|
1542 |
error should be generated. If there is already an EGLSurface associated with |
|
1543 |
pixmap (as a result of a previous eglCreatePixmapSurface call), then a |
|
1544 |
EGL_BAD_ALLOC error is generated. Finally, if the implementation cannotallocate |
|
1545 |
resources for the new EGL pixmap, an EGL_BAD_ALLOC error is generated. |
|
1546 |
*/ |
|
1547 |
EGLSurface CGuestEGL::eglCreatePixmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, EGLNativePixmapType aNativePixmap, const EGLint *aAttribList) |
|
1548 |
{ |
|
1549 |
EGL_TRACE( "CGuestEGL::eglCreatePixmapSurface"); |
|
1550 |
EGL_TRACE_ATTRIB_LIST(aAttribList); |
|
1551 |
||
1552 |
EGLSurface newSurfaceId = EGL_NO_SURFACE; |
|
1553 |
TSurfaceInfo* surfaceInfo = NULL; |
|
1554 |
EGLint error = EGL_BAD_DISPLAY; |
|
1555 |
TSymbianPixmapTypeId pixmapType = EPixmapTypeNone; |
|
1556 |
||
1557 |
const EGLint* pixmapMatch = TAttribUtils::FindAttribValue(aAttribList, EGL_MATCH_NATIVE_PIXMAP); |
|
1558 |
if ( pixmapMatch && ( (*pixmapMatch) != (EGLint)(aNativePixmap) ) ) |
|
1559 |
{ // if EGL_MATCH_NATIVE_PIXMAP is in the attribute list it must be the same pixmap as aNativePixmap |
|
1560 |
error = EGL_BAD_MATCH; |
|
1561 |
} |
|
1562 |
else |
|
1563 |
{ |
|
1564 |
iDisplayMapLock.WriteLock(); |
|
1565 |
CEglDisplayInfo** pDispInfo; |
|
1566 |
pDispInfo = iDisplayMap.Find(aDisplay); |
|
1567 |
||
1568 |
if (pDispInfo && *pDispInfo) |
|
1569 |
{ |
|
1570 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
1571 |
||
1572 |
surfaceInfo = new TSurfaceInfo(); |
|
1573 |
if (surfaceInfo) |
|
1574 |
{ |
|
1575 |
surfaceInfo->iConfigId = aConfig; |
|
1576 |
pixmapType = EglInternalFunction_GetNativePixmapType(aNativePixmap); |
|
1577 |
switch (pixmapType) |
|
1578 |
{ |
|
1579 |
case EPixmapTypeFbsBitmap: |
|
1580 |
newSurfaceId = CreateFbsBitmapSurface(aThreadState, aDisplay, aConfig, reinterpret_cast<CFbsBitmap*>(aNativePixmap), aAttribList, |
|
1581 |
*surfaceInfo); |
|
1582 |
break; |
|
1583 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
1584 |
case EPixmapTypeSgImage: |
|
1585 |
newSurfaceId = CreateSgImageSurface(aThreadState, aDisplay, aConfig, reinterpret_cast<const RSgImage*>(aNativePixmap), aAttribList, |
|
1586 |
*surfaceInfo); |
|
1587 |
break; |
|
1588 |
#endif |
|
1589 |
default: |
|
1590 |
break; |
|
1591 |
} |
|
1592 |
if (newSurfaceId == EGL_NO_SURFACE) |
|
1593 |
{ |
|
1594 |
error = EGL_BAD_NATIVE_PIXMAP; |
|
1595 |
} |
|
1596 |
else |
|
1597 |
{ |
|
1598 |
error = EGL_SUCCESS; |
|
1599 |
EGL_TRACE( "CGuestEGL::eglCreatePixmapSurface inserting surface 0x%x to display %d", newSurfaceId, aDisplay); |
|
1600 |
if (KErrNone != (*pDispInfo)->iSurfaceMap.Insert(newSurfaceId, surfaceInfo)) |
|
1601 |
{ |
|
1602 |
error = EGL_BAD_ALLOC; |
|
1603 |
if (pixmapType == EPixmapTypeFbsBitmap) |
|
1604 |
{ |
|
1605 |
(void) eglDestroySurface(aThreadState, aDisplay, newSurfaceId); |
|
1606 |
} |
|
1607 |
newSurfaceId = EGL_NO_SURFACE; |
|
1608 |
} |
|
1609 |
} |
|
1610 |
if (error != EGL_SUCCESS) |
|
1611 |
{ |
|
1612 |
delete surfaceInfo; |
|
1613 |
surfaceInfo = NULL; |
|
1614 |
} |
|
1615 |
} |
|
1616 |
else |
|
1617 |
{ |
|
1618 |
error = EGL_BAD_ALLOC; |
|
1619 |
} |
|
1620 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
1621 |
} // dispInfo |
|
1622 |
iDisplayMapLock.Unlock(); |
|
1623 |
} |
|
1624 |
||
1625 |
aThreadState.SetEglError(error); |
|
1626 |
||
1627 |
// parameter check failed |
|
1628 |
if (error != EGL_SUCCESS) |
|
1629 |
{ |
|
1630 |
EGLPANIC_ASSERT_DEBUG(newSurfaceId == EGL_NO_SURFACE, EEglPanicTemp); |
|
1631 |
EGLPANIC_ASSERT_DEBUG(surfaceInfo == NULL, EEglPanicTemp); |
|
1632 |
return EGL_NO_SURFACE; |
|
1633 |
} |
|
1634 |
||
1635 |
EGLPANIC_ASSERT_DEBUG(newSurfaceId != EGL_NO_SURFACE, EEglPanicTemp); |
|
1636 |
EGLPANIC_ASSERT_DEBUG(surfaceInfo != NULL, EEglPanicTemp); |
|
1637 |
||
1638 |
return newSurfaceId; |
|
1639 |
} |
|
1640 |
||
1641 |
EGLSurface CGuestEGL::CreateFbsBitmapSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, CFbsBitmap* aBitmap, |
|
1642 |
const EGLint *aAttribList, TSurfaceInfo& aSurfaceInfo) |
|
1643 |
{ |
|
1644 |
EGLSurface newSurfaceId = EGL_NO_SURFACE; |
|
1645 |
aSurfaceInfo.iSurfaceType = ESurfaceTypePixmapFbsBitmap; |
|
1646 |
aSurfaceInfo.iFbsBitmap = aBitmap; |
|
1647 |
||
1648 |
TDisplayMode mode = ENone; |
|
1649 |
TInt stride; |
|
1650 |
aSurfaceInfo.iSize = aBitmap->SizeInPixels(); |
|
1651 |
EGL_TRACE("CGuestEGL::CreateFbsBitmapSurface image width=%d, height=%d", aSurfaceInfo.iSize.iWidth, aSurfaceInfo.iSize.iHeight); |
|
1652 |
||
1653 |
// check that a pixmap surface has not previously been created from this CFbsBitmap |
|
1654 |
if (!EglInternalFunction_PixmapSurfacePreviouslyCreated(aBitmap, EPixmapTypeFbsBitmap)) |
|
1655 |
{ |
|
1656 |
// error = EGL_BAD_ALLOC; |
|
1657 |
return EGL_NO_SURFACE; |
|
1658 |
} |
|
1659 |
else |
|
1660 |
{ |
|
1661 |
mode = aBitmap->DisplayMode(); |
|
1662 |
if (EGL_SUCCESS != ConfigMatchesFbsBitmapPixmap(aThreadState, aDisplay, aConfig, aAttribList, mode)) |
|
1663 |
{ |
|
1664 |
return EGL_NO_SURFACE; |
|
1665 |
} |
|
1666 |
} |
|
1667 |
||
1668 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1669 |
stride = CFbsBitmap::ScanLineLength(aSurfaceInfo.iSize.iWidth, mode); |
|
1670 |
eglApiData.Init( EglRFC::EeglCreatePixmapSurface ); |
|
1671 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1672 |
eglApiData.AppendEGLConfig(aConfig); |
|
1673 |
eglApiData.AppendEGLNativePixmapType((EGLNativePixmapType) aBitmap); |
|
1674 |
eglApiData.AppendEGLint(mode); |
|
1675 |
eglApiData.AppendEGLSize(aSurfaceInfo.iSize); |
|
1676 |
eglApiData.AppendEGLint(stride); |
|
1677 |
eglApiData.AppendEGLint(EPixmapTypeFbsBitmap); |
|
1678 |
eglApiData.AppendEGLintVector(aAttribList, TAttribUtils::AttribListLength(aAttribList)); |
|
1679 |
newSurfaceId = aThreadState.ExecEglSurfaceCmd(eglApiData); |
|
1680 |
EGL_TRACE( "EeglCreatePixmapSurface aDisplay=%d, config=%d, format=%d, width=%d, height=%d, stride=%d, pixmapType=%d, newSurface=%d", |
|
1681 |
aDisplay, aConfig, mode, aSurfaceInfo.iSize.iWidth, aSurfaceInfo.iSize.iHeight, stride, EPixmapTypeFbsBitmap, newSurfaceId); |
|
1682 |
||
1683 |
aSurfaceInfo.iHostSurfaceId = newSurfaceId; |
|
1684 |
return newSurfaceId; |
|
1685 |
} |
|
1686 |
||
1687 |
#ifdef FAISALMEMON_S4_SGIMAGE |
|
1688 |
EGLSurface CGuestEGL::CreateSgImageSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const RSgImage* aSgImage, |
|
1689 |
const EGLint *aAttribList, TSurfaceInfo& aSurfaceInfo) |
|
1690 |
{ |
|
1691 |
// ToDo check that the SgImage is not already being used for a surface or EglImage |
|
1692 |
aSurfaceInfo.iSurfaceType = ESurfaceTypePixmapSgImage; |
|
1693 |
aSurfaceInfo.iSgId = aSgImage->Id(); |
|
1694 |
||
1695 |
EGL_TRACE("CGuestEGL::CreateSgImageSurface sgImage id 0x%lx", aSurfaceInfo.iSgId); |
|
1696 |
TSgImageInfo imgInfo; |
|
1697 |
// ToDo ensure SgImage has correct suitable usage bits |
|
1698 |
if ( (aSurfaceInfo.iSgId != KSgNullDrawableId) && (KErrNone == aSurfaceInfo.iSgHandle.Open(aSurfaceInfo.iSgId)) && |
|
1699 |
(KErrNone == aSgImage->GetInfo(imgInfo)) ) |
|
1700 |
{ |
|
1701 |
EGL_TRACE("CGuestEGL::CreateSgImageSurface 1. SgImage PixelFormat=%d; size=%d,%d; Usage=0x%x", |
|
1702 |
imgInfo.iPixelFormat, imgInfo.iSizeInPixels.iWidth, imgInfo.iSizeInPixels.iHeight, imgInfo.iUsage); |
|
1703 |
aSurfaceInfo.iSize = imgInfo.iSizeInPixels; |
|
1704 |
||
1705 |
/* Package the handles to 64-bit value, since there's only one parameter available. |
|
1706 |
pbufferHandle is the lower 32 bits, VGImageHandle is the upper bits. */ |
|
1707 |
TUint64 sgHandles; |
|
1708 |
EGLint hostResult = CVghwUtils::EglGetSgHandles(aSurfaceInfo.iSgId.iId, &sgHandles); |
|
1709 |
EGL_TRACE("CGuestEGL::CreateSgImageSurface 2. EglGetSgHandles result=%d, sgHandles=0x%lx", hostResult, sgHandles); |
|
1710 |
aSurfaceInfo.iHostSurfaceId = (EGLSurface)(sgHandles&0xFFFFFFFF); |
|
1711 |
return aSurfaceInfo.iHostSurfaceId; |
|
1712 |
} |
|
1713 |
||
1714 |
aSurfaceInfo.iSgHandle.Close(); |
|
1715 |
return EGL_NO_SURFACE; |
|
1716 |
} |
|
1717 |
#endif |
|
1718 |
||
1719 |
// ----------------------------------------------------------------------------- |
|
1720 |
// |
|
1721 |
// ----------------------------------------------------------------------------- |
|
1722 |
// |
|
1723 |
TSurfaceInfo* CGuestEGL::EglInternalFunction_GetPlatformSurface( EGLDisplay display, EGLSurface surface ) |
|
1724 |
{ |
|
1725 |
EGL_TRACE( "CGuestEGL::EglInternalFunction_GetPlatformSurface"); |
|
1726 |
TSurfaceInfo* result = NULL; |
|
1727 |
||
1728 |
iDisplayMapLock.ReadLock(); |
|
1729 |
||
1730 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find( display ); |
|
1731 |
if (pDispInfo && *pDispInfo) |
|
1732 |
{ |
|
1733 |
TSurfaceInfo** pSurfaceInfo = (*pDispInfo)->iSurfaceMap.Find( surface ); |
|
1734 |
if (pSurfaceInfo) |
|
1735 |
{ |
|
1736 |
result = *pSurfaceInfo; |
|
1737 |
} |
|
1738 |
} |
|
1739 |
||
1740 |
// TODO on success should probably Unlock() the surface in the caller |
|
1741 |
iDisplayMapLock.Unlock(); |
|
1742 |
||
1743 |
/* TODO review calling code, to see if this suggestion makes sense |
|
1744 |
if (result == NULL) |
|
1745 |
{ |
|
1746 |
EGL_RAISE_ERROR( EGL_BAD_SURFACE, NULL); //Enable this when all surfaces are in surface map |
|
1747 |
} |
|
1748 |
*/ |
|
1749 |
return result; |
|
1750 |
} |
|
1751 |
||
1752 |
// ----------------------------------------------------------------------------- |
|
1753 |
// |
|
1754 |
// ----------------------------------------------------------------------------- |
|
1755 |
// |
|
1756 |
EGLBoolean CGuestEGL::eglWaitClient(TEglThreadState& aThreadState) |
|
1757 |
{ |
|
1758 |
EGL_TRACE( "CGuestEGL::eglWaitClient"); |
|
1759 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1760 |
eglApiData.Init(EglRFC::EeglWaitClient); |
|
1761 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
1762 |
||
1763 |
if (result) |
|
1764 |
{ |
|
1765 |
// ToDo cache in client, check results are not EGL_NO_DISPLAY / EGL_NO_SURFACE |
|
1766 |
EGLDisplay display = eglGetCurrentDisplay(aThreadState); |
|
1767 |
EGLSurface surface = eglGetCurrentSurface(aThreadState, EGL_DRAW); |
|
1768 |
iDisplayMapLock.ReadLock(); |
|
1769 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find( display ); |
|
1770 |
TSurfaceInfo* surfaceInfo = NULL; |
|
1771 |
||
1772 |
if (!pDispInfo || !*pDispInfo) |
|
1773 |
{ |
|
1774 |
EGL_TRACE( "cannot find display %d", display ); |
|
1775 |
} |
|
1776 |
else |
|
1777 |
{ |
|
1778 |
TSurfaceInfo** pSurfaceInfo = (*pDispInfo)->iSurfaceMap.Find( surface ); |
|
1779 |
if (!pSurfaceInfo) |
|
1780 |
{ |
|
1781 |
EGL_TRACE( "cannot find surface %d for display %d", surface, display ); |
|
1782 |
} |
|
1783 |
else |
|
1784 |
{ |
|
1785 |
surfaceInfo = *pSurfaceInfo; |
|
1786 |
} |
|
1787 |
} |
|
1788 |
iDisplayMapLock.Unlock(); |
|
1789 |
if (surfaceInfo == NULL) |
|
1790 |
{ |
|
1791 |
return EGL_FALSE; |
|
1792 |
} |
|
1793 |
if (surfaceInfo->iSurfaceType == ESurfaceTypePixmapFbsBitmap) |
|
1794 |
{ |
|
1795 |
EGLPANIC_ASSERT_DEBUG(surfaceInfo->iFbsBitmap, EEglPanicTemp); |
|
1796 |
surfaceInfo->iFbsBitmap->BeginDataAccess(); |
|
1797 |
||
1798 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1799 |
eglApiData.Init( EglRFC::EeglSimulatorCopyImageData ); |
|
1800 |
const TSize sizePixels( surfaceInfo->iFbsBitmap->Header().iSizeInPixels ); |
|
1801 |
eglApiData.AppendVector( (void*)surfaceInfo->iFbsBitmap->DataAddress(), |
|
1802 |
CFbsBitmap::ScanLineLength( sizePixels.iWidth, surfaceInfo->iFbsBitmap->DisplayMode() )*sizePixels.iHeight, |
|
1803 |
RemoteFunctionCallData::EOut ); |
|
1804 |
aThreadState.ExecuteEglNeverErrorCmd(eglApiData); |
|
1805 |
||
1806 |
surfaceInfo->iFbsBitmap->EndDataAccess(); |
|
1807 |
} |
|
1808 |
} |
|
1809 |
||
1810 |
return result; |
|
1811 |
} |
|
1812 |
||
1813 |
// ----------------------------------------------------------------------------- |
|
1814 |
// |
|
1815 |
// ----------------------------------------------------------------------------- |
|
1816 |
// |
|
1817 |
EGLSurface CGuestEGL::eglGetCurrentSurface(TEglThreadState& aThreadState, EGLint aReadDraw) |
|
1818 |
{ |
|
1819 |
// ToDo cache in client |
|
1820 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1821 |
eglApiData.Init(EglRFC::EeglGetCurrentSurface); |
|
1822 |
eglApiData.AppendEGLint(aReadDraw); |
|
1823 |
return ExecEglSurfaceNoErrorCmd(aThreadState, eglApiData); |
|
1824 |
} |
|
1825 |
||
1826 |
// ----------------------------------------------------------------------------- |
|
1827 |
// |
|
1828 |
// ----------------------------------------------------------------------------- |
|
1829 |
// |
|
1830 |
EGLDisplay CGuestEGL::eglGetCurrentDisplay(TEglThreadState& aThreadState) |
|
1831 |
{ |
|
1832 |
// ToDo cache in client |
|
1833 |
EGL_TRACE("CGuestEGL::eglGetCurrentDisplay"); |
|
1834 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
1835 |
eglApiData.Init(EglRFC::EeglGetCurrentDisplay); |
|
1836 |
return ExecEglDisplayNoErrorCmd(aThreadState, eglApiData); |
|
1837 |
} |
|
1838 |
||
1839 |
// ----------------------------------------------------------------------------- |
|
1840 |
// |
|
1841 |
// ----------------------------------------------------------------------------- |
|
1842 |
// |
|
1843 |
EGLBoolean CGuestEGL::eglCopyBuffers(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLNativePixmapType aTarget) |
|
1844 |
{ |
|
1845 |
TSize pixmapSize; |
|
1846 |
||
1847 |
EGL_TRACE("CGuestEGL::eglCopyBuffers"); |
|
1848 |
EGLBoolean hostResult = EGL_FALSE; |
|
1849 |
TSymbianPixmapTypeId targetPixmapType = EglInternalFunction_GetNativePixmapType(aTarget); |
|
1850 |
||
1851 |
// Only CFbsBitmap native pixmaps are supported by this API. (SgImages are not supported, as per the SgImsge Lite spec.) |
|
1852 |
if ( (targetPixmapType == EPixmapTypeFbsBitmap) && EglInternalFunction_IsValidNativePixmap(aTarget, targetPixmapType) ) |
|
1853 |
{ |
|
1854 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData(rfcdata); |
|
1855 |
CFbsBitmap* bitmap = (CFbsBitmap*)aTarget; |
|
1856 |
TSize pixmapSize = bitmap->SizeInPixels(); |
|
1857 |
bitmap->BeginDataAccess(); |
|
1858 |
||
1859 |
TDisplayMode mode = bitmap->DisplayMode(); |
|
1860 |
EGLint stride = CFbsBitmap::ScanLineLength(bitmap->Header().iSizeInPixels.iWidth, mode); |
|
1861 |
void* data = bitmap->DataAddress(); |
|
1862 |
||
1863 |
#ifdef _DEBUG |
|
1864 |
char* modeName = NULL; |
|
1865 |
switch (mode) |
|
1866 |
{ |
|
1867 |
case ENone: modeName = "ENone"; break; |
|
1868 |
case EGray2: modeName = "EGray2"; break; |
|
1869 |
case EGray4: modeName = "EGray4"; break; |
|
1870 |
case EGray16: modeName = "EGray16"; break; |
|
1871 |
case EGray256: modeName = "EGray256"; break; |
|
1872 |
case EColor16: modeName = "EColor16"; break; |
|
1873 |
case EColor256: modeName = "EColor256"; break; |
|
1874 |
case EColor64K: modeName = "EColor64K"; break; |
|
1875 |
case EColor16M: modeName = "EColor16M"; break; |
|
1876 |
case ERgb: modeName = "ERgb"; break; |
|
1877 |
case EColor4K: modeName = "EColor4K"; break; |
|
1878 |
case EColor16MU: modeName = "EColor16MU"; break; |
|
1879 |
case EColor16MA: modeName = "EColor16MA"; break; |
|
1880 |
case EColor16MAP: modeName = "EColor16MAP"; break; |
|
1881 |
case EColorLast: modeName = "EColorLast"; break; |
|
1882 |
default: modeName = "unknown"; break; |
|
1883 |
} |
|
1884 |
EGL_TRACE("EglInternalFunction_GetNativePixmapInfo (0x%x) -> CFbsBitmap: DisplayMode=%d (\"%s\"), ScanLineLength=%d, data addr=0x%x", |
|
1885 |
bitmap, mode, modeName, stride, data); |
|
1886 |
#endif |
|
1887 |
||
1888 |
eglApiData.Init(EglRFC::EeglCopyBuffers); |
|
1889 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
1890 |
eglApiData.AppendEGLSurface(aSurface); |
|
1891 |
const TSize sizePixels( bitmap->Header().iSizeInPixels ); |
|
1892 |
eglApiData.AppendVector((void*)bitmap->DataAddress(), |
|
1893 |
stride*pixmapSize.iHeight, |
|
1894 |
RemoteFunctionCallData::EOut); |
|
1895 |
||
1896 |
eglApiData.AppendEGLint((EGLint) mode); |
|
1897 |
eglApiData.AppendEGLSize(pixmapSize); |
|
1898 |
eglApiData.AppendEGLint(stride); |
|
1899 |
eglApiData.AppendEGLint(targetPixmapType); |
|
1900 |
||
1901 |
hostResult = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
1902 |
bitmap->EndDataAccess(); |
|
1903 |
} |
|
1904 |
else |
|
1905 |
{ |
|
1906 |
aThreadState.SetEglError(EGL_BAD_NATIVE_PIXMAP); |
|
1907 |
} |
|
1908 |
||
1909 |
return hostResult; |
|
1910 |
} |
|
1911 |
||
1912 |
// ----------------------------------------------------------------------------- |
|
1913 |
// |
|
1914 |
// ----------------------------------------------------------------------------- |
|
1915 |
// |
|
1916 |
// Beware odd logic: EFalse if surface is found, otherwise ETrue |
|
1917 |
TBool CGuestEGL::EglInternalFunction_PixmapSurfacePreviouslyCreated(EGLNativePixmapType pixmap, TSymbianPixmapTypeId pixmapType) |
|
1918 |
{ |
|
1919 |
// ToDo keep a hashmap of pixmap addresses currently used for surfaces |
|
1920 |
TBool result = ETrue; |
|
1921 |
if(pixmapType == EPixmapTypeFbsBitmap) |
|
1922 |
{ |
|
1923 |
iDisplayMapLock.ReadLock(); |
|
1924 |
RHashMap<TInt, CEglDisplayInfo*>::TIter iter( iDisplayMap ); |
|
1925 |
for (;;) |
|
1926 |
{ |
|
1927 |
CEglDisplayInfo** pDispInfo = const_cast<CEglDisplayInfo**>(iter.NextValue()); |
|
1928 |
if (!pDispInfo || !*pDispInfo) |
|
1929 |
{ |
|
1930 |
break; |
|
1931 |
} |
|
1932 |
||
1933 |
RHashMap<TInt, TSurfaceInfo*>::TIter iter2((*pDispInfo)->iSurfaceMap); |
|
1934 |
for (;;) |
|
1935 |
{ |
|
1936 |
TSurfaceInfo** pSurfaceInfo = const_cast<TSurfaceInfo**>(iter2.NextValue()); |
|
1937 |
if (!pSurfaceInfo) |
|
1938 |
{ |
|
1939 |
break; |
|
1940 |
} |
|
1941 |
||
1942 |
TSurfaceInfo* surfaceInfo = *pSurfaceInfo; |
|
1943 |
if ( (surfaceInfo->iSurfaceType == ESurfaceTypePixmapFbsBitmap) && (surfaceInfo->iFbsBitmap == pixmap) ) |
|
1944 |
{ |
|
1945 |
result = EFalse; |
|
1946 |
} |
|
1947 |
} |
|
1948 |
} |
|
1949 |
iDisplayMapLock.Unlock(); |
|
1950 |
} |
|
1951 |
||
1952 |
EGL_TRACE("CGuestEGL::EglInternalFunction_PixmapSurfacePreviouslyCreated %d", result); |
|
1953 |
return result; |
|
1954 |
} |
|
1955 |
||
1956 |
// FAISALMEMON HOLE 2 |
|
1957 |
||
1958 |
EGLDisplay CGuestEGL::eglGetDisplay(TEglThreadState& aThreadState, EGLNativeDisplayType aDisplayId) |
|
1959 |
{ |
|
1960 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData(rfcdata); |
|
1961 |
eglApiData.Init(EglRFC::EeglGetDisplay); |
|
1962 |
eglApiData.AppendEGLNativeDisplayType(aDisplayId); |
|
1963 |
EGLDisplay display = ExecEglDisplayNoErrorCmd(aThreadState, eglApiData); |
|
1964 |
||
1965 |
if (display != EGL_NO_DISPLAY) |
|
1966 |
{ |
|
1967 |
if (!CreateDisplayInfo(display)) |
|
1968 |
{ // alloc failed |
|
1969 |
display = EGL_NO_DISPLAY; |
|
1970 |
} |
|
1971 |
} |
|
1972 |
return display; |
|
1973 |
} |
|
1974 |
||
1975 |
// ----------------------------------------------------------------------------- |
|
1976 |
// |
|
1977 |
// ----------------------------------------------------------------------------- |
|
1978 |
// |
|
1979 |
EGLint CGuestEGL::InitialiseExtensions() |
|
1980 |
{ |
|
1981 |
iEglSyncExtension = CEglSyncExtension::Create(*this); |
|
1982 |
return EGL_SUCCESS; |
|
1983 |
} |
|
1984 |
||
1985 |
||
1986 |
// API supporting EGL sync extension |
|
1987 |
// lock the display once found |
|
1988 |
EGLint CGuestEGL::FindAndLockDisplay(EGLDisplay aDisplay) |
|
1989 |
{ |
|
1990 |
EGLint result = EGL_BAD_DISPLAY; |
|
1991 |
EGL_TRACE("CGuestEGL::FindAndLockDisplay aDisplay=%d", aDisplay); |
|
1992 |
iDisplayMapLock.ReadLock(); |
|
1993 |
CEglDisplayInfo** pDisp = iDisplayMap.Find(aDisplay); |
|
1994 |
if (pDisp && *pDisp) |
|
1995 |
{ |
|
1996 |
CEglDisplayInfo* disp = *pDisp; |
|
1997 |
if (disp->iInitialized) |
|
1998 |
{ |
|
1999 |
EGL_TRACE("CGuestEGL::FindAndLockDisplay display found"); |
|
2000 |
result = EGL_SUCCESS; |
|
2001 |
} |
|
2002 |
else |
|
2003 |
{ |
|
2004 |
EGL_TRACE("CGuestEGL::FindAndLockDisplay display not initialized"); |
|
2005 |
result = EGL_NOT_INITIALIZED; |
|
2006 |
} |
|
2007 |
} |
|
2008 |
else |
|
2009 |
{ |
|
2010 |
EGL_TRACE("CGuestEGL::FindAndLockDisplay cannot find display"); |
|
2011 |
} |
|
2012 |
if (result != EGL_SUCCESS) |
|
2013 |
{ |
|
2014 |
iDisplayMapLock.Unlock(); |
|
2015 |
} |
|
2016 |
return result; |
|
2017 |
} |
|
2018 |
||
2019 |
// release the lock |
|
2020 |
void CGuestEGL::ReleaseDisplayLock(EGLDisplay aDisplay) |
|
2021 |
{ |
|
2022 |
EGL_TRACE("CGuestEGL::ReleaseDisplayLock aDisplay=%d", aDisplay); |
|
2023 |
iDisplayMapLock.Unlock(); |
|
2024 |
} |
|
2025 |
||
2026 |
||
2027 |
CEglSyncExtension* CGuestEGL::EGLSyncExtension() |
|
2028 |
{ |
|
2029 |
return iEglSyncExtension; |
|
2030 |
} |
|
2031 |
||
2032 |
||
2033 |
/* |
|
2034 |
EGL_FALSE is returned on failure and major and minor are not updated. An |
|
2035 |
EGL_BAD_DISPLAY error is generated if the dpy argument does not refer to a valid |
|
2036 |
EGLDisplay. An EGL_NOT_INITIALIZED error is generated if EGL cannot be |
|
2037 |
initialized for an otherwise valid dpy. |
|
2038 |
*/ |
|
2039 |
EGLBoolean CGuestEGL::eglInitialize(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLint *aMajor, EGLint *aMinor) |
|
2040 |
{ |
|
2041 |
if ((aDisplay == EGL_NO_DISPLAY) || !InitializeDisplayInfo(aDisplay)) |
|
2042 |
{ |
|
2043 |
aThreadState.SetEglError(EGL_BAD_DISPLAY); |
|
2044 |
return EGL_FALSE; |
|
2045 |
} |
|
2046 |
||
2047 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData(rfcdata); |
|
2048 |
eglApiData.Init(EglRFC::EeglInitialize); |
|
2049 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2050 |
EGLBoolean ret = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2051 |
||
2052 |
if(ret) |
|
2053 |
{ |
|
2054 |
if(aMajor) |
|
2055 |
*aMajor = EGL_VERSION_MAJOR; |
|
2056 |
if(aMinor) |
|
2057 |
*aMinor = EGL_VERSION_MINOR; |
|
2058 |
} |
|
2059 |
EGL_TRACE("eglInitialize <-" ); |
|
2060 |
return ret; |
|
2061 |
} |
|
2062 |
||
2063 |
/* |
|
2064 |
Returns EGL_FALSE on failure and value is not updated. If attribute is not a |
|
2065 |
valid EGL surface attribute, then an EGL_BAD_ATTRIBUTE error is generated. If |
|
2066 |
surface is not a valid EGLSurface then an EGL_BAD_SURFACE error is generated. |
|
2067 |
*/ |
|
2068 |
EGLBoolean CGuestEGL::eglQuerySurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aAttribute, EGLint *aValue) |
|
2069 |
{ |
|
2070 |
// ToDo more parameter validation, and possibly use cached values |
|
2071 |
if ( (aValue == NULL) || (3 & (TUint32)aValue) ) |
|
2072 |
{ |
|
2073 |
aThreadState.SetEglError(EGL_BAD_PARAMETER); |
|
2074 |
return EGL_FALSE; |
|
2075 |
} |
|
2076 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2077 |
eglApiData.Init(EglRFC::EeglQuerySurface); |
|
2078 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2079 |
eglApiData.AppendEGLSurface(aSurface); |
|
2080 |
eglApiData.AppendEGLint(aAttribute); |
|
2081 |
eglApiData.AppendEGLintVector(aValue, 1, RemoteFunctionCallData::EOut); |
|
2082 |
||
2083 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2084 |
EGL_TRACE_GET_ATTRIB("eglQuerySurface", "surface", aDisplay, aSurface, aAttribute, aValue, result); |
|
2085 |
return result; |
|
2086 |
} |
|
2087 |
||
2088 |
/* |
|
2089 |
On failure eglCreatePbufferFromClientBuffer returns EGL_NO_SURFACE. In |
|
2090 |
addition to the errors described eglCreatePbufferSurface, |
|
2091 |
eglCreatePbufferFromClientBuffer may fail and generate errors for the |
|
2092 |
following reasons: |
|
2093 |
* If buftype is not a recognized client API resource type (e.g. is not |
|
2094 |
EGL_OPENVG_IMAGE), an EGL_BAD_PARAMETER error is generated. |
|
2095 |
* If buffer is not a valid handle or name of a client API resource of the |
|
2096 |
specified buftype in the currently bound context corresponding to that |
|
2097 |
type, an EGL_BAD_PARAMETER error is generated. |
|
2098 |
* If the buffers contained in buffer do not correspond to a proper subset |
|
2099 |
of the buffers described by config, and match the bit depths for those |
|
2100 |
buffers specified in config, then an EGL_BAD_MATCH error is generated. |
|
2101 |
For example, a VGImage with pixel format VG_lRGBA_8888 corresponds to an |
|
2102 |
EGLConfig with EGL_RED_SIZE, EGL_GREEN_SIZE, EGL_BLUE_SIZE, and |
|
2103 |
EGL_ALPHA_SIZE values of 8. |
|
2104 |
* If no context corresponding to the specified buftype is current, an |
|
2105 |
EGL_BAD_ACCESS error is generated. |
|
2106 |
* There may be additional constraints on which types of buffers may be |
|
2107 |
bound to EGL surfaces, as described in client API specifications. If |
|
2108 |
those constraints are violated, then an EGL_BAD_MATCH error is generated. |
|
2109 |
* If buffer is already bound to another pbuffer, or is in use by a client |
|
2110 |
API an EGL_BAD_ACCESS error is generated. |
|
2111 |
*/ |
|
2112 |
EGLSurface CGuestEGL::eglCreatePbufferFromClientBuffer(TEglThreadState& aThreadState, |
|
2113 |
EGLDisplay aDisplay, EGLenum aBufType, EGLClientBuffer aBuffer, EGLConfig aConfig, const EGLint *aAttribList) |
|
2114 |
{ |
|
2115 |
// ToDo validate parameters |
|
2116 |
// ToDo SgImage Design Spec 5.12 - eglCreatePbufferFromClientBuffer should fail with EGL_BAD_ACCESS for VgImages derived from SgImages |
|
2117 |
EGL_TRACE("eglCreatePbufferFromClientBuffer %d %d %d", aDisplay, aBufType, aConfig); |
|
2118 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2119 |
eglApiData.Init(EglRFC::EeglCreatePbufferFromClientBuffer); |
|
2120 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2121 |
eglApiData.AppendEGLenum(aBufType); |
|
2122 |
eglApiData.AppendEGLClientBuffer(aBuffer); |
|
2123 |
eglApiData.AppendEGLConfig(aConfig); |
|
2124 |
eglApiData.AppendEGLintVector(aAttribList, TAttribUtils::AttribListLength(aAttribList) ); |
|
2125 |
||
2126 |
return aThreadState.ExecEglSurfaceCmd(eglApiData); |
|
2127 |
} |
|
2128 |
||
2129 |
/* |
|
2130 |
If the dpy argument does not refer to a valid EGLDisplay, EGL_FALSE is |
|
2131 |
returned, and an EGL_BAD_DISPLAY error is generated. |
|
2132 |
*/ |
|
2133 |
EGLBoolean CGuestEGL::eglTerminate(TEglThreadState& aThreadState, EGLDisplay aDisplay) |
|
2134 |
{ |
|
2135 |
EGLBoolean success = EGL_FALSE; |
|
2136 |
if (DestroyDisplayInfo(aDisplay)) |
|
2137 |
{ |
|
2138 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2139 |
eglApiData.Init(EglRFC::EeglTerminate); |
|
2140 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2141 |
||
2142 |
success = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2143 |
EGL_TRACE("eglTerminate display=%d ret=%d", aDisplay, success); |
|
2144 |
} |
|
2145 |
else |
|
2146 |
{ |
|
2147 |
aThreadState.SetEglError(EGL_BAD_DISPLAY); |
|
2148 |
} |
|
2149 |
||
2150 |
return success; |
|
2151 |
} |
|
2152 |
||
2153 |
/* |
|
2154 |
On failure, EGL_FALSE is returned. An EGL_NOT_INITIALIZED error is generated |
|
2155 |
if EGL is not initialized on dpy. An EGL_BAD_PARAMETER error is generated |
|
2156 |
if num config is NULL. |
|
2157 |
*/ |
|
2158 |
EGLBoolean CGuestEGL::eglGetConfigs(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig *aConfigs, |
|
2159 |
EGLint aConfigSize, EGLint *aNumConfig) |
|
2160 |
{ |
|
2161 |
EGLint error = EGL_SUCCESS; |
|
2162 |
||
2163 |
if (aNumConfig == NULL) |
|
2164 |
{ |
|
2165 |
error = EGL_BAD_PARAMETER; |
|
2166 |
} |
|
2167 |
||
2168 |
// ToDo check display is valid |
|
2169 |
if (error != EGL_SUCCESS) |
|
2170 |
{ |
|
2171 |
aThreadState.SetEglError(EGL_BAD_PARAMETER); |
|
2172 |
return EGL_FALSE; |
|
2173 |
} |
|
2174 |
if (aConfigs && !aConfigSize) |
|
2175 |
aConfigSize = 1; |
|
2176 |
else if (!aConfigs) |
|
2177 |
aConfigSize = 0; |
|
2178 |
||
2179 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2180 |
eglApiData.Init(EglRFC::EeglGetConfigs); |
|
2181 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2182 |
eglApiData.AppendEGLConfigVector(aConfigs, aConfigSize, RemoteFunctionCallData::EOut); |
|
2183 |
eglApiData.AppendEGLint(aConfigSize); |
|
2184 |
eglApiData.AppendEGLintVector(aNumConfig, 1, RemoteFunctionCallData::EOut); |
|
2185 |
||
2186 |
// ToDo cache successful result for next time |
|
2187 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2188 |
return result; |
|
2189 |
} |
|
2190 |
||
2191 |
EGLBoolean CGuestEGL::eglChooseConfig(TEglThreadState& aThreadState, EGLDisplay aDisplay, const EGLint *aAttribList, |
|
2192 |
EGLConfig *aConfigs, EGLint aConfigSize, EGLint *aNumConfig) |
|
2193 |
{ |
|
2194 |
if (aConfigs && !aConfigSize) |
|
2195 |
{ |
|
2196 |
aConfigSize = 1; |
|
2197 |
} |
|
2198 |
else if (!aConfigs) |
|
2199 |
{ |
|
2200 |
aConfigSize = 0; |
|
2201 |
} |
|
2202 |
||
2203 |
const EGLint* surfaceType = TAttribUtils::FindAttribValue(aAttribList, EGL_SURFACE_TYPE); |
|
2204 |
if (surfaceType && (*surfaceType & EGL_PIXMAP_BIT)) |
|
2205 |
{ |
|
2206 |
EGL_TRACE("CGuestEGL::eglChooseConfig for Pixmap Surface"); |
|
2207 |
const EGLint* pixmapMatch = TAttribUtils::FindAttribValue(aAttribList, EGL_MATCH_NATIVE_PIXMAP); |
|
2208 |
if (pixmapMatch && *pixmapMatch) |
|
2209 |
{ |
|
2210 |
EGL_TRACE("CGuestEGL::eglChooseConfig attributes include EGL_MATCH_NATIVE_PIXMAP, value is 0x%x", *pixmapMatch); |
|
2211 |
// check/copy color & alpha sizes from pixmap |
|
2212 |
return ChooseConfigForPixmapSurface(aThreadState, aDisplay, aAttribList, aConfigs, aConfigSize, aNumConfig, (const void*)*pixmapMatch); |
|
2213 |
} |
|
2214 |
else |
|
2215 |
{ // Pixmap to match is missing |
|
2216 |
EGL_TRACE("CGuestEGL::eglChooseConfig EGL_MATCH_NATIVE_PIXMAP attribute is missing or NULL"); |
|
2217 |
aThreadState.SetEglError(EGL_BAD_PARAMETER); |
|
2218 |
return EGL_FALSE; |
|
2219 |
} |
|
2220 |
} |
|
2221 |
||
2222 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2223 |
eglApiData.Init( EglRFC::EeglChooseConfig ); |
|
2224 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2225 |
eglApiData.AppendEGLintVector(aAttribList, TAttribUtils::AttribListLength(aAttribList)); |
|
2226 |
eglApiData.AppendEGLConfigVector(aConfigs, aConfigSize, RemoteFunctionCallData::EOut ); |
|
2227 |
eglApiData.AppendEGLint(aConfigSize); |
|
2228 |
eglApiData.AppendEGLintVector(aNumConfig, 1, RemoteFunctionCallData::EOut); |
|
2229 |
||
2230 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2231 |
} |
|
2232 |
||
2233 |
/* |
|
2234 |
On failure returns EGL_FALSE. If attribute |
|
2235 |
is not a valid attribute then EGL_BAD_ATTRIBUTE is generated. |
|
2236 |
*/ |
|
2237 |
EGLBoolean CGuestEGL::eglGetConfigAttrib(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, |
|
2238 |
EGLint aAttribute, EGLint *aValue) |
|
2239 |
{ |
|
2240 |
// ToDo validate display & aAttribute, and maybe get result from local cache |
|
2241 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2242 |
eglApiData.Init(EglRFC::EeglGetConfigAttrib); |
|
2243 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2244 |
eglApiData.AppendEGLConfig(aConfig); |
|
2245 |
eglApiData.AppendEGLint(aAttribute); |
|
2246 |
eglApiData.AppendEGLintVector(aValue, 1, RemoteFunctionCallData::EOut); |
|
2247 |
||
2248 |
EGLBoolean result = aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2249 |
EGL_TRACE_GET_ATTRIB("eglGetConfigAttrib", "config", aDisplay, aConfig, aAttribute, aValue, result); |
|
2250 |
return result; |
|
2251 |
} |
|
2252 |
||
2253 |
/* |
|
2254 |
Returns EGL_FALSE on failure and value is not updated. If attribute is not a |
|
2255 |
valid EGL surface attribute, then an EGL_BAD_ATTRIBUTE error is generated. If |
|
2256 |
surface is not a valid EGLSurface then an EGL_BAD_SURFACE error is generated. |
|
2257 |
*/ |
|
2258 |
EGLBoolean CGuestEGL::eglSurfaceAttrib(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, |
|
2259 |
EGLint aAttribute, EGLint aValue) |
|
2260 |
{ |
|
2261 |
EGL_TRACE_SET_ATTRIB("eglSurfaceAttrib", "surface", aDisplay, aSurface, aAttribute, aValue); |
|
2262 |
||
2263 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2264 |
eglApiData.Init(EglRFC::EeglSurfaceAttrib); |
|
2265 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2266 |
eglApiData.AppendEGLSurface(aSurface); |
|
2267 |
eglApiData.AppendEGLint(aAttribute); |
|
2268 |
eglApiData.AppendEGLint(aValue); |
|
2269 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2270 |
} |
|
2271 |
||
2272 |
/* |
|
2273 |
If eglBindTexImage is called and the surface attribute EGL_TEXTURE_FORMAT is set |
|
2274 |
to EGL_NO_TEXTURE, then an EGL_BAD_MATCH error is returned. If buffer is already |
|
2275 |
bound to a texture then an EGL_BAD_ACCESS error is returned. If buffer is not a |
|
2276 |
valid buffer, then an EGL_BAD_PARAMETER error is generated. If surface is not a |
|
2277 |
valid EGLSurface, or is not a pbuffer surface supporting texture |
|
2278 |
binding, then an EGL_BAD_SURFACE error is generated. |
|
2279 |
*/ |
|
2280 |
EGLBoolean CGuestEGL::eglBindTexImage(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aBuffer) |
|
2281 |
{ |
|
2282 |
// ToDo validate parameters |
|
2283 |
if ( (aBuffer == NULL) || (3 & (TUint)aBuffer)) |
|
2284 |
{ |
|
2285 |
aThreadState.SetEglError(EGL_BAD_PARAMETER); |
|
2286 |
return EGL_FALSE; |
|
2287 |
} |
|
2288 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2289 |
eglApiData.Init(EglRFC::EeglBindTexImage); |
|
2290 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2291 |
eglApiData.AppendEGLSurface(aSurface); |
|
2292 |
eglApiData.AppendEGLint(aBuffer); |
|
2293 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2294 |
} |
|
2295 |
||
2296 |
/* |
|
2297 |
If the value of surface attribute EGL_TEXTURE_FORMAT is EGL_NO_TEXTURE, |
|
2298 |
then an EGL_BAD_MATCH error is returned. If buffer is not a valid buffer |
|
2299 |
(currently only EGL_BACK_BUFFER may be specified), then an |
|
2300 |
EGL_BAD_PARAMETER error is generated. If surface is not a valid EGLSurface, |
|
2301 |
or is not a bound pbuffer surface, then an EGL_BAD_SURFACE error is |
|
2302 |
returned. |
|
2303 |
*/ |
|
2304 |
EGLBoolean CGuestEGL::eglReleaseTexImage(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLint aBuffer) |
|
2305 |
{ |
|
2306 |
// ToDo validate parameters |
|
2307 |
if ( (aBuffer == NULL) || (3 & (TUint)aBuffer)) |
|
2308 |
{ |
|
2309 |
aThreadState.SetEglError(EGL_BAD_PARAMETER); |
|
2310 |
return EGL_FALSE; |
|
2311 |
} |
|
2312 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2313 |
eglApiData.Init(EglRFC::EeglReleaseTexImage); |
|
2314 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2315 |
eglApiData.AppendEGLSurface(aSurface); |
|
2316 |
eglApiData.AppendEGLint(aBuffer); |
|
2317 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2318 |
} |
|
2319 |
||
2320 |
/* |
|
2321 |
Returns EGL_FALSE on failure. If there is no current context on the calling |
|
2322 |
thread, a EGL_BAD_CONTEXT error is generated. If there is no surface bound |
|
2323 |
to the current context, a EGL_BAD_SURFACE error is generated. |
|
2324 |
*/ |
|
2325 |
EGLBoolean CGuestEGL::eglSwapInterval(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLint aInterval) |
|
2326 |
{ |
|
2327 |
// ToDo validate parameters |
|
2328 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2329 |
eglApiData.Init(EglRFC::EeglSwapInterval); |
|
2330 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2331 |
eglApiData.AppendEGLint(aInterval); |
|
2332 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2333 |
} |
|
2334 |
||
2335 |
/* |
|
2336 |
On failure returns EGL_NO_CONTEXT. If the current rendering api is EGL_NONE, |
|
2337 |
then an EGL_BAD_MATCH error is generated (this situation can only arise in |
|
2338 |
an implementation which does not support OpenGL ES, and prior to the first |
|
2339 |
call to eglBindAPI). If share context is neither zero nor a valid context |
|
2340 |
of the same client API type as the newly created context, then an EGL_- |
|
2341 |
BAD_CONTEXT error is generated. |
|
2342 |
||
2343 |
... |
|
2344 |
*/ |
|
2345 |
EGLContext CGuestEGL::eglCreateContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, |
|
2346 |
EGLContext aShareContext, const EGLint *aAttribList) |
|
2347 |
{ |
|
2348 |
EGLContext result = EGL_NO_CONTEXT; |
|
2349 |
iDisplayMapLock.ReadLock(); |
|
2350 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
2351 |
if (!pDispInfo || !*pDispInfo) |
|
2352 |
{ |
|
2353 |
EGL_TRACE("cannot find display %d", aDisplay); |
|
2354 |
} |
|
2355 |
else |
|
2356 |
{ |
|
2357 |
CEglContext* shareContext = NULL; |
|
2358 |
if (aShareContext) |
|
2359 |
{ |
|
2360 |
CEglContext** pContext = (*pDispInfo)->iContextMap.Find(aShareContext); |
|
2361 |
if (!pContext || (*pContext)->IsDestroyed()) |
|
2362 |
{ |
|
2363 |
EGL_TRACE("cannot find share context %d for display %d, or it is destroyed", aShareContext, aDisplay); |
|
2364 |
aThreadState.SetEglError(EGL_BAD_CONTEXT); |
|
2365 |
iDisplayMapLock.Unlock(); |
|
2366 |
return EGL_NO_CONTEXT; |
|
2367 |
} |
|
2368 |
} |
|
2369 |
||
2370 |
CEglContext* newContext = CEglContext::Create(aThreadState, aDisplay, aConfig, shareContext, aAttribList); |
|
2371 |
if (newContext) |
|
2372 |
{ |
|
2373 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
2374 |
TInt err = (*pDispInfo)->iContextMap.Insert(newContext->ClientContext(), newContext); |
|
2375 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
2376 |
if (err != KErrNone) |
|
2377 |
{ |
|
2378 |
newContext->Destroy(aThreadState); |
|
2379 |
aThreadState.SetEglError(EGL_BAD_ALLOC); |
|
2380 |
} |
|
2381 |
else |
|
2382 |
{ |
|
2383 |
result = newContext->ClientContext(); |
|
2384 |
} |
|
2385 |
} |
|
2386 |
} |
|
2387 |
||
2388 |
iDisplayMapLock.Unlock(); |
|
2389 |
return result; |
|
2390 |
} |
|
2391 |
||
2392 |
/* |
|
2393 |
Returns EGL_FALSE on failure. An EGL_BAD_CONTEXT error is generated if ctx is |
|
2394 |
not a valid context. |
|
2395 |
*/ |
|
2396 |
EGLBoolean CGuestEGL::eglDestroyContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLContext aContext) |
|
2397 |
{ |
|
2398 |
EGLBoolean success = EGL_FALSE; |
|
2399 |
iDisplayMapLock.ReadLock(); |
|
2400 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
2401 |
if (!pDispInfo || !*pDispInfo) |
|
2402 |
{ |
|
2403 |
EGL_TRACE("cannot find display %d", aDisplay); |
|
2404 |
aThreadState.SetEglError(EGL_BAD_DISPLAY); |
|
2405 |
} |
|
2406 |
else |
|
2407 |
{ |
|
2408 |
CEglContext** pContext = (*pDispInfo)->iContextMap.Find(aContext); |
|
2409 |
if (!pContext || (*pContext)->IsDestroyed()) |
|
2410 |
{ |
|
2411 |
EGL_TRACE("cannot find context %d for display %d, or it is destroyed", aContext, aDisplay); |
|
2412 |
aThreadState.SetEglError(EGL_BAD_CONTEXT); |
|
2413 |
} |
|
2414 |
else |
|
2415 |
{ |
|
2416 |
success = EGL_TRUE; |
|
2417 |
if ((*pContext)->Destroy(aThreadState)) |
|
2418 |
{ |
|
2419 |
RHeap* threadHeap = CVghwUtils::SwitchToVghwHeap(); |
|
2420 |
(*pDispInfo)->iContextMap.Remove(aContext); |
|
2421 |
CVghwUtils::SwitchFromVghwHeap(threadHeap); |
|
2422 |
} |
|
2423 |
EGL_TRACE("eglDestroyContext end"); |
|
2424 |
} |
|
2425 |
} |
|
2426 |
||
2427 |
iDisplayMapLock.Unlock(); |
|
2428 |
return success; |
|
2429 |
} |
|
2430 |
||
2431 |
/* |
|
2432 |
Returns EGL_FALSE on failure and value is not updated. If attribute is not |
|
2433 |
a valid EGL context attribute, then an EGL_BAD_ATTRIBUTE error is generated. |
|
2434 |
If ctx is invalid, an EGL_BAD_CONTEXT error is generated. |
|
2435 |
*/ |
|
2436 |
EGLBoolean CGuestEGL::eglQueryContext(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLContext aContext, EGLint aAttribute, EGLint *aValue) |
|
2437 |
{ |
|
2438 |
EGLBoolean success = EGL_FALSE; |
|
2439 |
iDisplayMapLock.ReadLock(); |
|
2440 |
CEglDisplayInfo** pDispInfo = iDisplayMap.Find(aDisplay); |
|
2441 |
if (!pDispInfo || !*pDispInfo) |
|
2442 |
{ |
|
2443 |
EGL_TRACE("cannot find display %d", aDisplay); |
|
2444 |
aThreadState.SetEglError(EGL_BAD_DISPLAY); |
|
2445 |
} |
|
2446 |
else |
|
2447 |
{ |
|
2448 |
CEglContext** pContext = (*pDispInfo)->iContextMap.Find(aContext); |
|
2449 |
if (!pContext || (*pContext)->IsDestroyed()) |
|
2450 |
{ |
|
2451 |
EGL_TRACE("cannot find context %d for display %d, or it is destroyed", aContext, aDisplay); |
|
2452 |
aThreadState.SetEglError(EGL_BAD_CONTEXT); |
|
2453 |
} |
|
2454 |
else |
|
2455 |
{ |
|
2456 |
success = (*pContext)->QueryAttribute(aThreadState, aAttribute, aValue); |
|
2457 |
} |
|
2458 |
} |
|
2459 |
||
2460 |
iDisplayMapLock.Unlock(); |
|
2461 |
return success; |
|
2462 |
} |
|
2463 |
||
2464 |
/* |
|
2465 |
On failure returns EGL_NO_SURFACE. If the pbuffer could not be created due |
|
2466 |
to insufficient resources, then an EGL_BAD_ALLOC error is generated. If |
|
2467 |
config is not a valid EGLConfig, an EGL_BAD_CONFIG error is generated. If |
|
2468 |
the value specified for either EGL_WIDTH or EGL_HEIGHT is less than zero, |
|
2469 |
an EGL_BAD_PARAMETER error is generated. If config does not support |
|
2470 |
pbuffers, an EGL_BAD_MATCH error is generated. |
|
2471 |
||
2472 |
... see also comment on exported API |
|
2473 |
*/ |
|
2474 |
EGLSurface CGuestEGL::eglCreatePbufferSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLConfig aConfig, const EGLint *aAttribList) |
|
2475 |
{ |
|
2476 |
// ToDo validate parameters |
|
2477 |
// ToDo store info about surface |
|
2478 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2479 |
eglApiData.Init(EglRFC::EeglCreatePbufferSurface); |
|
2480 |
eglApiData.AppendEGLDisplay(aDisplay); |
|
2481 |
eglApiData.AppendEGLConfig(aConfig); |
|
2482 |
eglApiData.AppendEGLintVector(aAttribList, TAttribUtils::AttribListLength(aAttribList) ); |
|
2483 |
return aThreadState.ExecEglBooleanCmd(eglApiData); |
|
2484 |
} |
|
2485 |
||
2486 |
/* |
|
2487 |
If there is no current context for the current rendering API, or if the |
|
2488 |
current rendering API is EGL_NONE, then EGL_NO_CONTEXT is returned (this |
|
2489 |
is not an error). |
|
2490 |
*/ |
|
2491 |
EGLContext CGuestEGL::eglGetCurrentContext(TEglThreadState& aThreadState) |
|
2492 |
{ |
|
2493 |
// ToDo should have this information cached |
|
2494 |
RemoteFunctionCallData rfcdata; EglRFC eglApiData( rfcdata ); |
|
2495 |
eglApiData.Init(EglRFC::EeglGetCurrentContext); |
|
2496 |
return ExecEglContextNoErrorCmd(aThreadState, eglApiData); |
|
2497 |
} |
|
2498 |
||
2499 |
/** |
|
2500 |
* |
|
2501 |
* |
|
2502 |
* @param aConfigs handle to an EGLConfig pointer, where the new configuration data will be. Ownership is transferred to the client. |
|
2503 |
* @param aConfigsCnt number of configs that will be in aConfigs upon returning |
|
2504 |
* |
|
2505 |
* @param aConfigAttribs handle to a pointer, where the memory will be allocated, and data copied. This will contain a list of |
|
2506 |
* config attribute _values_, in the order set out in eglrfc::MetaGetConfigAttribute(). |
|
2507 |
* Format: c1attrval1, c1attrval2, ..., c2attrval1, c2attrval2, ... cNattrvalM |
|
2508 |
* (the number of attribute values per config is eglrfc::MetaGetConfigAttributeCnt() |
|
2509 |
* Ownership is transferred to the client. |
|
2510 |
* @param aConfigAttribsLen handle to an integer value, where the size of the above vector will be stored. |
|
2511 |
* @param aFetchMode: which configs to fetch, default = EMetaGetConfigsSg (get configs that support sgImage), possible values are |
|
2512 |
* EMetaGetConfigsAll, //get all the configs available |
|
2513 |
* EMetaGetConfigsSg, //get configs supporting sg images |
|
2514 |
* EMetaGetConfigsNonSg, //get configs not supporting sg images |
|
2515 |
* (only sgImage implemented!) |
|
2516 |
* |
|
2517 |
*/ |
|
2518 |
TBool CGuestEGL::EglInternalFunction_MetaGetConfigs(TEglThreadState& aThreadState, EGLConfig*& aConfigs, EGLint& aConfigCnt, EGLint*& aConfigAttribs, EGLint& aConfigAttribsLen, TMetaGetConfigsMode aFetchMode ) |
|
2519 |
{ |
|
2520 |
aConfigCnt = KConfigsMaxCnt; |
|
2521 |
//TODO: optimize this so that the length is the number of returned items |
|
2522 |
aConfigs = (EGLConfig*) CVghwUtils::Alloc( sizeof(EGLConfig) * aConfigCnt ); |
|
2523 |
aConfigAttribsLen = KConfigsMaxCnt * 29; |
|
2524 |
//TODO: optimize this so that the length is the number of returned items |
|
2525 |
aConfigAttribs = (EGLint*) CVghwUtils::Alloc( sizeof(EGLint) * aConfigAttribsLen ); |
|
2526 |
||
2527 |
RemoteFunctionCallData rfcdata; EglRFC call( rfcdata ); |
|
2528 |
call.Init( EglRFC::EeglMetaGetConfigs ); |
|
2529 |
call.AppendEGLintVector( aConfigs, aConfigCnt, RemoteFunctionCallData::EInOut ); |
|
2530 |
call.AppendEGLintVector( aConfigAttribs, aConfigAttribsLen, RemoteFunctionCallData::EInOut ); |
|
2531 |
||
2532 |
call.AppendEGLint( (EGLint)aFetchMode ); |
|
2533 |
||
2534 |
return aThreadState.ExecEglBooleanCmd( call ); |
|
2535 |
} |
|
2536 |
||
2537 |
||
2538 |
// Private interfaces for EGL to call into Open VG & Open GL ES |
|
2539 |
// class MVgApiForEgl - redirects via CVghwUtils to exported functions from Open VG |
|
2540 |
ExtensionProcPointer CGuestEGL::guestGetVgProcAddress (const char *aProcName) |
|
2541 |
{ |
|
2542 |
if (!iVgApiForEgl) |
|
2543 |
{ |
|
2544 |
iVgApiForEgl = CVghwUtils::VgApiForEgl(); |
|
2545 |
} |
|
2546 |
if (iVgApiForEgl) |
|
2547 |
{ |
|
2548 |
return iVgApiForEgl->guestGetVgProcAddress(aProcName); |
|
2549 |
} |
|
2550 |
return NULL; |
|
2551 |
} |
|
2552 |
||
2553 |
||
2554 |
// class MGles11ApiForEgl - redirects via CVghwUtils to exported functions from Open GL ES 1.1 |
|
2555 |
ExtensionProcPointer CGuestEGL::guestGetGles11ProcAddress (const char *aProcName) |
|
2556 |
{ |
|
2557 |
if (!iGles11ApiForEgl) |
|
2558 |
{ |
|
2559 |
iGles11ApiForEgl = CVghwUtils::Gles11ApiForEgl(); |
|
2560 |
} |
|
2561 |
if (iGles11ApiForEgl) |
|
2562 |
{ |
|
2563 |
return iGles11ApiForEgl->guestGetGles11ProcAddress(aProcName); |
|
2564 |
} |
|
2565 |
return NULL; |
|
2566 |
} |
|
2567 |
||
2568 |
||
2569 |
// class MGles2ApiForEgl - redirects via CVghwUtils to exported functions from Open GL ES 2 |
|
2570 |
ExtensionProcPointer CGuestEGL::guestGetGles2ProcAddress (const char *aProcName) |
|
2571 |
{ |
|
2572 |
if (!iGles2ApiForEgl) |
|
2573 |
{ |
|
2574 |
iGles2ApiForEgl = CVghwUtils::Gles2ApiForEgl(); |
|
2575 |
} |
|
2576 |
if (iGles2ApiForEgl) |
|
2577 |
{ |
|
2578 |
return iGles2ApiForEgl->guestGetGles2ProcAddress(aProcName); |
|
2579 |
} |
|
2580 |
return NULL; |
|
2581 |
} |