sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "confighelper.h"
|
sl@0
|
17 |
#include "directgdiadapter.h"
|
sl@0
|
18 |
#include <pixelformats.h>
|
sl@0
|
19 |
#include <EGL/egltypes.h>
|
sl@0
|
20 |
#include <fbs.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
Symbian Config Attributes for EGL pixmaps / pbuffers / windows.
|
sl@0
|
24 |
*/
|
sl@0
|
25 |
const EGLint TConfigHelper::KSurfaceAttribs[][19] =
|
sl@0
|
26 |
{
|
sl@0
|
27 |
{
|
sl@0
|
28 |
// EColor64K == EUidPixelFormatRGB_565
|
sl@0
|
29 |
// 16 bpp: 5 bits red, 6 bits green, 5 bits blue
|
sl@0
|
30 |
//
|
sl@0
|
31 |
EGL_BUFFER_SIZE, 16,
|
sl@0
|
32 |
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
sl@0
|
33 |
EGL_RED_SIZE, 5,
|
sl@0
|
34 |
EGL_GREEN_SIZE, 6,
|
sl@0
|
35 |
EGL_BLUE_SIZE, 5,
|
sl@0
|
36 |
EGL_ALPHA_SIZE, 0,
|
sl@0
|
37 |
EGL_LUMINANCE_SIZE, 0,
|
sl@0
|
38 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
39 |
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
|
sl@0
|
40 |
EGL_NONE
|
sl@0
|
41 |
},
|
sl@0
|
42 |
{
|
sl@0
|
43 |
//EColor16MAP == EUidPixelFormatARGB_8888_PRE
|
sl@0
|
44 |
// 32 bpp: 8 bits premultiplied alpha, 8 bits red, 8 bits green, 8 bits blue
|
sl@0
|
45 |
//
|
sl@0
|
46 |
EGL_BUFFER_SIZE, 32,
|
sl@0
|
47 |
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
sl@0
|
48 |
EGL_RED_SIZE, 8,
|
sl@0
|
49 |
EGL_GREEN_SIZE, 8,
|
sl@0
|
50 |
EGL_BLUE_SIZE, 8,
|
sl@0
|
51 |
EGL_ALPHA_SIZE, 8,
|
sl@0
|
52 |
EGL_LUMINANCE_SIZE, 0,
|
sl@0
|
53 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
54 |
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT,
|
sl@0
|
55 |
EGL_NONE
|
sl@0
|
56 |
},
|
sl@0
|
57 |
{
|
sl@0
|
58 |
// EColor16MU == EUidPixelFormatXRGB_8888
|
sl@0
|
59 |
// 32 bpp: 8 bits alpha (ignored), 8 bits red, 8 bits green, 8 bits blue
|
sl@0
|
60 |
//
|
sl@0
|
61 |
EGL_BUFFER_SIZE, 24,
|
sl@0
|
62 |
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
sl@0
|
63 |
EGL_RED_SIZE, 8,
|
sl@0
|
64 |
EGL_GREEN_SIZE, 8,
|
sl@0
|
65 |
EGL_BLUE_SIZE, 8,
|
sl@0
|
66 |
EGL_ALPHA_SIZE, 0,
|
sl@0
|
67 |
EGL_LUMINANCE_SIZE, 0,
|
sl@0
|
68 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
69 |
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
|
sl@0
|
70 |
EGL_NONE
|
sl@0
|
71 |
},
|
sl@0
|
72 |
{
|
sl@0
|
73 |
//EColor16MA == EUidPixelFormatARGB_8888
|
sl@0
|
74 |
// 32 bpp: 8 bits alpha, 8 bits red, 8 bits green, 8 bits blue
|
sl@0
|
75 |
//
|
sl@0
|
76 |
EGL_BUFFER_SIZE, 32,
|
sl@0
|
77 |
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
sl@0
|
78 |
EGL_RED_SIZE, 8,
|
sl@0
|
79 |
EGL_GREEN_SIZE, 8,
|
sl@0
|
80 |
EGL_BLUE_SIZE, 8,
|
sl@0
|
81 |
EGL_ALPHA_SIZE, 8,
|
sl@0
|
82 |
EGL_LUMINANCE_SIZE, 0,
|
sl@0
|
83 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
84 |
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
|
sl@0
|
85 |
EGL_NONE
|
sl@0
|
86 |
},
|
sl@0
|
87 |
{
|
sl@0
|
88 |
// EGray256 == EUidPixelFormatL_8
|
sl@0
|
89 |
// 8 bpp: 8 bits luminance
|
sl@0
|
90 |
//
|
sl@0
|
91 |
EGL_BUFFER_SIZE, 8,
|
sl@0
|
92 |
EGL_COLOR_BUFFER_TYPE, EGL_LUMINANCE_BUFFER,
|
sl@0
|
93 |
EGL_RED_SIZE, 0,
|
sl@0
|
94 |
EGL_GREEN_SIZE, 0,
|
sl@0
|
95 |
EGL_BLUE_SIZE, 0,
|
sl@0
|
96 |
EGL_ALPHA_SIZE, 0,
|
sl@0
|
97 |
EGL_LUMINANCE_SIZE, 8,
|
sl@0
|
98 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
99 |
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
|
sl@0
|
100 |
EGL_NONE
|
sl@0
|
101 |
},
|
sl@0
|
102 |
{
|
sl@0
|
103 |
// EGray2 == EUidPixelFormatL_1
|
sl@0
|
104 |
// 1 bpp: 1 bit luminance
|
sl@0
|
105 |
//
|
sl@0
|
106 |
EGL_BUFFER_SIZE, 1,
|
sl@0
|
107 |
EGL_COLOR_BUFFER_TYPE, EGL_LUMINANCE_BUFFER,
|
sl@0
|
108 |
EGL_RED_SIZE, 0,
|
sl@0
|
109 |
EGL_GREEN_SIZE, 0,
|
sl@0
|
110 |
EGL_BLUE_SIZE, 0,
|
sl@0
|
111 |
EGL_ALPHA_SIZE, 0,
|
sl@0
|
112 |
EGL_LUMINANCE_SIZE, 1,
|
sl@0
|
113 |
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
|
sl@0
|
114 |
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
|
sl@0
|
115 |
EGL_NONE
|
sl@0
|
116 |
}
|
sl@0
|
117 |
};
|
sl@0
|
118 |
|
sl@0
|
119 |
/**
|
sl@0
|
120 |
Finds the exact matching configuration from the available configurations, based on the attribute values.
|
sl@0
|
121 |
|
sl@0
|
122 |
@pre aConfigs should not be NULL and EGL has been initialised.
|
sl@0
|
123 |
@return The index of the matching config if successful, otherwise -1.
|
sl@0
|
124 |
*/
|
sl@0
|
125 |
TInt TConfigHelper::GetSuitablePixmapConfigIndex(EGLDisplay aDisplay, EGLConfig *aConfigs, TInt aNumConfigs, TInt aColorAttrib)
|
sl@0
|
126 |
{
|
sl@0
|
127 |
EGLint value;
|
sl@0
|
128 |
|
sl@0
|
129 |
#ifdef _DEBUG_DIRECTGDI
|
sl@0
|
130 |
TBuf16<256> message;
|
sl@0
|
131 |
message.Format(_L("ColorAtrib : %d"), aColorAttrib);
|
sl@0
|
132 |
GRAPHICS_LOGD_DEBUG(message);
|
sl@0
|
133 |
|
sl@0
|
134 |
const TPtrC KEglAttribs[] =
|
sl@0
|
135 |
{
|
sl@0
|
136 |
_L("EGL_BUFFER_SIZE"),
|
sl@0
|
137 |
_L("EGL_COLOR_BUFFER_TYPE"),
|
sl@0
|
138 |
_L("EGL_RED_SIZE"),
|
sl@0
|
139 |
_L("EGL_GREEN_SIZE"),
|
sl@0
|
140 |
_L("EGL_BLUE_SIZE"),
|
sl@0
|
141 |
_L("EGL_ALPHA_SIZE"),
|
sl@0
|
142 |
_L("EGL_LUMINANCE_SIZE"),
|
sl@0
|
143 |
_L("EGL_RENDERABLE_TYPE"),
|
sl@0
|
144 |
_L("EGL_SURFACE_TYPE"),
|
sl@0
|
145 |
};
|
sl@0
|
146 |
#endif
|
sl@0
|
147 |
|
sl@0
|
148 |
TBool found = EFalse;
|
sl@0
|
149 |
for (TInt i=0; i<aNumConfigs && !found && aConfigs; i++)
|
sl@0
|
150 |
{
|
sl@0
|
151 |
found = ETrue;
|
sl@0
|
152 |
#ifdef _DEBUG_DIRECTGDI
|
sl@0
|
153 |
message.Format(_L("Trying to match with config number: %d"), i);
|
sl@0
|
154 |
GRAPHICS_LOGD_DEBUG(message);
|
sl@0
|
155 |
#endif
|
sl@0
|
156 |
for(TInt j=EEglBufferSize; j<ELast && found; ++++j)
|
sl@0
|
157 |
{
|
sl@0
|
158 |
eglGetConfigAttrib(aDisplay, aConfigs[i], KSurfaceAttribs[aColorAttrib][j], &value);
|
sl@0
|
159 |
found = EglAttributeMatches(KSurfaceAttribs[aColorAttrib][j], KSurfaceAttribs[aColorAttrib][j+1], value);
|
sl@0
|
160 |
|
sl@0
|
161 |
#ifdef _DEBUG_DIRECTGDI
|
sl@0
|
162 |
message.Format(_L("%S: Trying to match: %d From EGL: %d\n"), &KEglAttribs[j>>1], KSurfaceAttribs[aColorAttrib][j+1], value);
|
sl@0
|
163 |
GRAPHICS_LOGD_DEBUG(message);
|
sl@0
|
164 |
#endif
|
sl@0
|
165 |
}
|
sl@0
|
166 |
if (found)
|
sl@0
|
167 |
{
|
sl@0
|
168 |
#ifdef _DEBUG_DIRECTGDI
|
sl@0
|
169 |
message.Format(_L("Found a suitable EGL Config: %d\n"), i);
|
sl@0
|
170 |
GRAPHICS_LOGD_DEBUG(message);
|
sl@0
|
171 |
#endif
|
sl@0
|
172 |
return i;
|
sl@0
|
173 |
}
|
sl@0
|
174 |
}
|
sl@0
|
175 |
return -1;
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
/**
|
sl@0
|
179 |
Helper function for GetSuitablePixmapConfigIndex(). Returns, for the given attribute, whether or not the
|
sl@0
|
180 |
expected value matches the value received from egl. The kind of match is dependant on the attribute being tested.
|
sl@0
|
181 |
|
sl@0
|
182 |
@param aAttribute The EGL attribute ID.
|
sl@0
|
183 |
@param aExpected The value we require the attribute to have for the current config we are testing.
|
sl@0
|
184 |
@param aActual The value read from the current EGL config for this attribute.
|
sl@0
|
185 |
@return ETrue, if aActual is deemed to match aExpected, otherwise EFalse.
|
sl@0
|
186 |
*/
|
sl@0
|
187 |
TBool TConfigHelper::EglAttributeMatches(EGLint aAttribute, TInt aExpected, TInt aActual)
|
sl@0
|
188 |
{
|
sl@0
|
189 |
switch(aAttribute)
|
sl@0
|
190 |
{
|
sl@0
|
191 |
case EGL_RENDERABLE_TYPE:
|
sl@0
|
192 |
case EGL_SURFACE_TYPE:
|
sl@0
|
193 |
// These are bitwise masks, so we don't need an exact match, just the bits to be set.
|
sl@0
|
194 |
return ((aExpected & aActual) == aExpected);
|
sl@0
|
195 |
default:
|
sl@0
|
196 |
return (aExpected == aActual);
|
sl@0
|
197 |
}
|
sl@0
|
198 |
}
|
sl@0
|
199 |
|
sl@0
|
200 |
/**
|
sl@0
|
201 |
Converts the pixel type into an enum of supported pixel types. If a pixel type is not supported, it
|
sl@0
|
202 |
is scaled to the nearest one.
|
sl@0
|
203 |
Six destination pixel types are supported.
|
sl@0
|
204 |
|
sl@0
|
205 |
@panic DGDIAdapter 1009, if the pixel type is not supported.
|
sl@0
|
206 |
|
sl@0
|
207 |
@return Equivalent pixel type, as an index into KPixmapAttribs[].
|
sl@0
|
208 |
*/
|
sl@0
|
209 |
TInt TConfigHelper::MatchPixelType(TInt aPixelType)
|
sl@0
|
210 |
{
|
sl@0
|
211 |
TInt selPixmapAttribs = 0;
|
sl@0
|
212 |
switch(aPixelType)
|
sl@0
|
213 |
{
|
sl@0
|
214 |
case EUidPixelFormatP_4:
|
sl@0
|
215 |
case EUidPixelFormatP_8:
|
sl@0
|
216 |
case EUidPixelFormatXRGB_4444:
|
sl@0
|
217 |
case EUidPixelFormatRGB_565:
|
sl@0
|
218 |
selPixmapAttribs = EPixmapAttribsColor64K;
|
sl@0
|
219 |
break;
|
sl@0
|
220 |
case EUidPixelFormatARGB_8888_PRE:
|
sl@0
|
221 |
selPixmapAttribs = EPixmapAttribsColor16MAP;
|
sl@0
|
222 |
break;
|
sl@0
|
223 |
case EUidPixelFormatRGB_888:
|
sl@0
|
224 |
case EUidPixelFormatXRGB_8888:
|
sl@0
|
225 |
selPixmapAttribs = EPixmapAttribsColor16MU;
|
sl@0
|
226 |
break;
|
sl@0
|
227 |
case EUidPixelFormatARGB_8888:
|
sl@0
|
228 |
selPixmapAttribs = EPixmapAttribsColor16MA;
|
sl@0
|
229 |
break;
|
sl@0
|
230 |
case EUidPixelFormatL_1:
|
sl@0
|
231 |
selPixmapAttribs = EPixmapAttribsLuminance1L;
|
sl@0
|
232 |
break;
|
sl@0
|
233 |
case EUidPixelFormatL_2:
|
sl@0
|
234 |
case EUidPixelFormatL_4:
|
sl@0
|
235 |
case EUidPixelFormatL_8:
|
sl@0
|
236 |
selPixmapAttribs = EPixmapAttribsLuminance8L;
|
sl@0
|
237 |
break;
|
sl@0
|
238 |
default:
|
sl@0
|
239 |
GRAPHICS_PANIC_ALWAYS(EDirectGdiPanicInvalidDisplayMode);
|
sl@0
|
240 |
}
|
sl@0
|
241 |
return selPixmapAttribs;
|
sl@0
|
242 |
}
|
sl@0
|
243 |
|
sl@0
|
244 |
/**
|
sl@0
|
245 |
Given a TUidPixelFormat, returns an EGLConfig matching it.
|
sl@0
|
246 |
If no exact match can be found, then returns the first available config.
|
sl@0
|
247 |
|
sl@0
|
248 |
@param aAttributeArrayIndex Index into config attribute array.
|
sl@0
|
249 |
@param aResult The resulting EGL config.
|
sl@0
|
250 |
|
sl@0
|
251 |
@pre EGL has been initialised.
|
sl@0
|
252 |
|
sl@0
|
253 |
@return KErrNone if a suitable config was found, otherwise one of the system-wide error codes.
|
sl@0
|
254 |
*/
|
sl@0
|
255 |
TInt TConfigHelper::GetConfig (TInt aAttributeArrayIndex, EGLConfig& aResult)
|
sl@0
|
256 |
{
|
sl@0
|
257 |
// Choose config
|
sl@0
|
258 |
EGLint numConfigs = 0;
|
sl@0
|
259 |
EGLDisplay display = eglGetCurrentDisplay();
|
sl@0
|
260 |
|
sl@0
|
261 |
if (!eglGetConfigs(display, NULL, 0, &numConfigs))
|
sl@0
|
262 |
return KErrGeneral;
|
sl@0
|
263 |
|
sl@0
|
264 |
if (numConfigs == 0)
|
sl@0
|
265 |
return KErrNotFound;
|
sl@0
|
266 |
|
sl@0
|
267 |
EGLConfig* configs = new EGLConfig[numConfigs];
|
sl@0
|
268 |
if (configs == NULL)
|
sl@0
|
269 |
return KErrNoMemory;
|
sl@0
|
270 |
|
sl@0
|
271 |
TInt match = -1;
|
sl@0
|
272 |
if (eglChooseConfig(display, KSurfaceAttribs[aAttributeArrayIndex], configs, numConfigs, &numConfigs))
|
sl@0
|
273 |
{
|
sl@0
|
274 |
match = GetSuitablePixmapConfigIndex(display, configs, numConfigs, aAttributeArrayIndex);
|
sl@0
|
275 |
//If no exact match can be found, then take the first config.
|
sl@0
|
276 |
if(match == -1)
|
sl@0
|
277 |
match = 0;
|
sl@0
|
278 |
aResult = configs[match];
|
sl@0
|
279 |
}
|
sl@0
|
280 |
delete [] configs;
|
sl@0
|
281 |
return (match == -1) ? KErrNotFound : KErrNone;
|
sl@0
|
282 |
}
|
sl@0
|
283 |
|
sl@0
|
284 |
/**
|
sl@0
|
285 |
Given a CFbsBitmap, return an EGLConfig that matches its display mode.
|
sl@0
|
286 |
|
sl@0
|
287 |
@param aBitmap Bitmap to get config for.
|
sl@0
|
288 |
@param aResult The resulting EGL config, if found.
|
sl@0
|
289 |
|
sl@0
|
290 |
@pre aBitmap has already been validated by ValidateBitmap().
|
sl@0
|
291 |
|
sl@0
|
292 |
@return KErrNone if successful, otherwise one of the system-wide error codes.
|
sl@0
|
293 |
*/
|
sl@0
|
294 |
TInt TConfigHelper::GetConfigForFbsBitmap (const CFbsBitmap& aBitmap, EGLConfig& aResult)
|
sl@0
|
295 |
{
|
sl@0
|
296 |
TInt pixelType = -1;
|
sl@0
|
297 |
switch (aBitmap.DisplayMode())
|
sl@0
|
298 |
{
|
sl@0
|
299 |
case EGray2:
|
sl@0
|
300 |
pixelType = EUidPixelFormatL_1;
|
sl@0
|
301 |
break;
|
sl@0
|
302 |
case EGray4:
|
sl@0
|
303 |
pixelType = EUidPixelFormatL_2;
|
sl@0
|
304 |
break;
|
sl@0
|
305 |
case EGray16:
|
sl@0
|
306 |
pixelType = EUidPixelFormatL_4;
|
sl@0
|
307 |
break;
|
sl@0
|
308 |
case EGray256:
|
sl@0
|
309 |
pixelType = EUidPixelFormatL_8;
|
sl@0
|
310 |
break;
|
sl@0
|
311 |
case EColor16:
|
sl@0
|
312 |
pixelType = EUidPixelFormatP_4;
|
sl@0
|
313 |
break;
|
sl@0
|
314 |
case EColor256:
|
sl@0
|
315 |
pixelType = EUidPixelFormatP_8;
|
sl@0
|
316 |
break;
|
sl@0
|
317 |
case EColor4K:
|
sl@0
|
318 |
pixelType = EUidPixelFormatXRGB_4444;
|
sl@0
|
319 |
break;
|
sl@0
|
320 |
case EColor64K:
|
sl@0
|
321 |
pixelType = EUidPixelFormatRGB_565;
|
sl@0
|
322 |
break;
|
sl@0
|
323 |
case EColor16M:
|
sl@0
|
324 |
pixelType = EUidPixelFormatRGB_888;
|
sl@0
|
325 |
break;
|
sl@0
|
326 |
case EColor16MU:
|
sl@0
|
327 |
pixelType = EUidPixelFormatXRGB_8888;
|
sl@0
|
328 |
break;
|
sl@0
|
329 |
case EColor16MA:
|
sl@0
|
330 |
pixelType = EUidPixelFormatARGB_8888;
|
sl@0
|
331 |
break;
|
sl@0
|
332 |
case EColor16MAP:
|
sl@0
|
333 |
pixelType = EUidPixelFormatARGB_8888_PRE;
|
sl@0
|
334 |
break;
|
sl@0
|
335 |
default:
|
sl@0
|
336 |
return KErrNotSupported;
|
sl@0
|
337 |
}
|
sl@0
|
338 |
return GetConfig(MatchPixelType(pixelType), aResult);
|
sl@0
|
339 |
}
|
sl@0
|
340 |
|
sl@0
|
341 |
|
sl@0
|
342 |
//Currently not called anywhere. However, it may be useful for performance improvement
|
sl@0
|
343 |
//in the future. Will defer removing/reinstating until then.
|
sl@0
|
344 |
#ifdef _DEBUG
|
sl@0
|
345 |
/**
|
sl@0
|
346 |
Debug method to iterate over supported configurations and print significant attributes.
|
sl@0
|
347 |
Currently only EGL_OPENVG renderable types are displayed.
|
sl@0
|
348 |
|
sl@0
|
349 |
@pre EGL is initialised.
|
sl@0
|
350 |
@leave PushL().
|
sl@0
|
351 |
*/
|
sl@0
|
352 |
void TConfigHelper::SupportedSurfacePixelFormatsL()
|
sl@0
|
353 |
{
|
sl@0
|
354 |
EGLDisplay currentDisplay = eglGetCurrentDisplay();
|
sl@0
|
355 |
EGLint numConfigs;
|
sl@0
|
356 |
EGLConfig* configs;
|
sl@0
|
357 |
TInt bufferSize, depthSize, stencilSize, luminance, renderableType, surfaceType, A, R, G, B;
|
sl@0
|
358 |
|
sl@0
|
359 |
_LIT(KAttribFormat, "%3d: BDS-ARGBL: %2d, %2d, %2d - %d, %d, %d, %d, %d");
|
sl@0
|
360 |
_LIT(KEGL_OPENVG_BIT, ", EGL_OPENVG_BIT");
|
sl@0
|
361 |
_LIT(KEGL_PBUFFER_BIT, ", EGL_PBUFFER_BIT");
|
sl@0
|
362 |
_LIT(KEGL_PIXMAP_BIT, ", EGL_PIXMAP_BIT");
|
sl@0
|
363 |
_LIT(KEGL_VG_ALPHA_FORMAT_PRE_BIT, ", EGL_VG_ALPHA_FORMAT_PRE_BIT");
|
sl@0
|
364 |
|
sl@0
|
365 |
if (eglGetConfigs(currentDisplay, NULL, 0x00, &numConfigs) == EGL_TRUE)
|
sl@0
|
366 |
{
|
sl@0
|
367 |
configs = (EGLConfig*)User::Alloc (numConfigs * sizeof(EGLConfig));
|
sl@0
|
368 |
if (configs)
|
sl@0
|
369 |
{
|
sl@0
|
370 |
CleanupStack::PushL(configs);
|
sl@0
|
371 |
if (eglGetConfigs(currentDisplay, configs, numConfigs, &numConfigs) == EGL_TRUE)
|
sl@0
|
372 |
{
|
sl@0
|
373 |
for (TUint i = 0; i < numConfigs; i++)
|
sl@0
|
374 |
{
|
sl@0
|
375 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_BUFFER_SIZE, (EGLint*)&bufferSize);
|
sl@0
|
376 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_DEPTH_SIZE, (EGLint*)&depthSize);
|
sl@0
|
377 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_STENCIL_SIZE, (EGLint*)&stencilSize);
|
sl@0
|
378 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_ALPHA_SIZE, (EGLint*)&A);
|
sl@0
|
379 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_RED_SIZE, (EGLint*)&R);
|
sl@0
|
380 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_GREEN_SIZE, (EGLint*)&G);
|
sl@0
|
381 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_BLUE_SIZE, (EGLint*)&B);
|
sl@0
|
382 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_LUMINANCE_SIZE, (EGLint*)&luminance);
|
sl@0
|
383 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_RENDERABLE_TYPE, (EGLint*)&renderableType);
|
sl@0
|
384 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_RENDERABLE_TYPE, (EGLint*)&renderableType);
|
sl@0
|
385 |
eglGetConfigAttrib(currentDisplay, configs[i], EGL_SURFACE_TYPE, (EGLint*)&surfaceType);
|
sl@0
|
386 |
|
sl@0
|
387 |
if (renderableType & EGL_OPENVG_BIT)
|
sl@0
|
388 |
{
|
sl@0
|
389 |
TBuf<256> buf;
|
sl@0
|
390 |
buf.Format(KAttribFormat, i, bufferSize, depthSize, stencilSize, A, R, G, B, luminance);
|
sl@0
|
391 |
buf.Append(KEGL_OPENVG_BIT);
|
sl@0
|
392 |
|
sl@0
|
393 |
if (surfaceType & EGL_PBUFFER_BIT) buf.Append(KEGL_PBUFFER_BIT);
|
sl@0
|
394 |
if (surfaceType & EGL_PIXMAP_BIT) buf.Append(KEGL_PIXMAP_BIT);
|
sl@0
|
395 |
if (surfaceType & EGL_VG_ALPHA_FORMAT_PRE_BIT) buf.Append(KEGL_VG_ALPHA_FORMAT_PRE_BIT);
|
sl@0
|
396 |
RDebug::Print(buf);
|
sl@0
|
397 |
}
|
sl@0
|
398 |
}
|
sl@0
|
399 |
}
|
sl@0
|
400 |
|
sl@0
|
401 |
CleanupStack::PopAndDestroy(1, configs);
|
sl@0
|
402 |
}
|
sl@0
|
403 |
}
|
sl@0
|
404 |
}
|
sl@0
|
405 |
#endif
|
sl@0
|
406 |
|