|
1 /* |
|
2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of CHuiVg10RenderPlugin. Rendering plugin for OpenVG 1.0. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "HuiVg10RenderPlugin.h" |
|
21 #include "HuiVg10RenderSurface.h" |
|
22 #include "HuiVg10PBufferSurface.h" |
|
23 #include "HuiVg10Gc.h" |
|
24 #include "HuiVg10Texture.h" |
|
25 #include "HuiVg10TextureManager.h" |
|
26 #include "HuiVg10CurvePath.h" |
|
27 #include "huivg10canvasgc.h" |
|
28 #include "HuiRasterizedTextMesh.h" |
|
29 #include "uiacceltk/HuiStatic.h" |
|
30 #include "uiacceltk/HuiPanic.h" |
|
31 #include "uiacceltk/HuiUtil.h" |
|
32 #include "uiacceltk/HuiEnv.h" |
|
33 #include "uiacceltk/HuiDisplay.h" |
|
34 #include "HuiFxVg10Engine.h" |
|
35 |
|
36 #ifdef __NVG |
|
37 #include <nvg.h> |
|
38 #include "HuiVg10VgImageBinder.h" |
|
39 #endif |
|
40 |
|
41 #include <AknUtils.h> |
|
42 #include <implementationproxy.h> |
|
43 |
|
44 #if !defined(EGL_VERSION_1_2) |
|
45 # error At least EGL version 1.2 is required by the OpenVG render plugin. |
|
46 #endif |
|
47 |
|
48 |
|
49 |
|
50 const TImplementationProxy ImplementationTable[] = |
|
51 { |
|
52 IMPLEMENTATION_PROXY_ENTRY( 0x200184B8, CHuiVg10RenderPlugin::NewL ) |
|
53 }; |
|
54 |
|
55 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) |
|
56 { |
|
57 aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); |
|
58 return ImplementationTable; |
|
59 } |
|
60 |
|
61 |
|
62 CHuiVg10RenderPlugin* CHuiVg10RenderPlugin::NewL() |
|
63 { |
|
64 CHuiVg10RenderPlugin* self = CHuiVg10RenderPlugin::NewLC(); |
|
65 CleanupStack::Pop(self); |
|
66 return self; |
|
67 } |
|
68 |
|
69 |
|
70 CHuiVg10RenderPlugin* CHuiVg10RenderPlugin::NewLC() |
|
71 { |
|
72 CHuiVg10RenderPlugin* self = new (ELeave) CHuiVg10RenderPlugin(); |
|
73 CleanupStack::PushL(self); |
|
74 self->ConstructL(); |
|
75 return self; |
|
76 } |
|
77 |
|
78 |
|
79 CHuiVg10RenderPlugin::CHuiVg10RenderPlugin(THuiRenderPluginId aId) |
|
80 : CHuiRenderPlugin(aId) |
|
81 { |
|
82 } |
|
83 |
|
84 |
|
85 void CHuiVg10RenderPlugin::ConstructL() |
|
86 { |
|
87 HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Initializing Rendering plugin.") ); |
|
88 |
|
89 iIsHardwareAccelerated = EFalse; |
|
90 iEGLStateForTextureUpload.iContext = KErrNotFound; // this will be defined later by the first upload in CHuiVg10Texture::PushEGLContext |
|
91 iEglDisplay = NULL; |
|
92 iDefaultRenderSurface = NULL; |
|
93 |
|
94 |
|
95 // Restore (Create the EGL surfaces) |
|
96 RestoreL(); |
|
97 |
|
98 // The disable flag is defined in coretkoptions.mmh |
|
99 #ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
100 HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Create default PBuffer rendering surface for texture preloads.") ); |
|
101 // Create default PBuffer rendering surface. This will allow us to for instance preload |
|
102 // and create textures before actual rendering surface exists. |
|
103 iDefaultRenderSurface = CHuiVg10PBufferSurface::NewLC(*this, TSize(64, 64)); |
|
104 CleanupStack::Pop(iDefaultRenderSurface); |
|
105 iDefaultRenderSurface->MakeCurrent(); |
|
106 iIsHardwareAccelerated = IsHardwareAccelerated(); |
|
107 #endif |
|
108 HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Rendering plugin for OpenVG 1.0 ready.") ); |
|
109 |
|
110 // Initialize some "allow flags" which depend on used HW |
|
111 ReadAllowsSwapBufferPreserved(); |
|
112 ReadAllowsVisualPBufferSurfaces(); |
|
113 } |
|
114 |
|
115 CHuiVg10RenderPlugin::~CHuiVg10RenderPlugin() |
|
116 { |
|
117 Release(); |
|
118 |
|
119 #ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
120 if (iDefaultRenderSurface) |
|
121 { |
|
122 HUI_DEBUG(_L("CHuiVg10RenderPlugin::~CHuiVg10RenderPlugin() - Destroying default rendering surface.")); |
|
123 // Destroy default rendering surface |
|
124 delete iDefaultRenderSurface; iDefaultRenderSurface = NULL; |
|
125 } |
|
126 #endif |
|
127 |
|
128 } |
|
129 |
|
130 void CHuiVg10RenderPlugin::RestoreL() |
|
131 { |
|
132 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Restoring renderer..") ); |
|
133 |
|
134 // Get the display for drawing graphics. |
|
135 if (CHuiStatic::Env().GlesRefCounter() == 0) |
|
136 { |
|
137 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Getting default EGL Display.") ); |
|
138 iEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
|
139 if(iEglDisplay == EGL_NO_DISPLAY) |
|
140 { |
|
141 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - ERROR! No connection to EGL display was available.")); |
|
142 TInt eglerr = eglGetError(); |
|
143 switch (eglerr) |
|
144 { |
|
145 case EGL_BAD_ALLOC: |
|
146 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Cause: Out of memory. Leaving.")); |
|
147 User::Leave(KErrNoMemory); |
|
148 default: |
|
149 HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - EGL information for the error: %S (EGL error code: %i). Leaving."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr); |
|
150 case EGL_SUCCESS: |
|
151 User::Leave(KErrNotSupported); |
|
152 } |
|
153 } |
|
154 EGLint majorVersion=0; |
|
155 EGLint minorVersion=0; |
|
156 |
|
157 // Initialize display. |
|
158 if(eglInitialize(iEglDisplay, &majorVersion, &minorVersion) == EGL_FALSE) |
|
159 { |
|
160 TInt eglerr = eglGetError(); |
|
161 switch (eglerr) |
|
162 { |
|
163 case EGL_BAD_ALLOC: |
|
164 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Cause: Out of memory. Leaving.")); |
|
165 User::Leave(KErrNoMemory); |
|
166 default: |
|
167 HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - ERROR! Failed to initialize EGL display. Cause: %S (EGL error code: %i). Leaving."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr); |
|
168 case EGL_SUCCESS: // indicates that no error was recorded, but still the eglInitialize call failed (=> unable to continue!) |
|
169 case EGL_NOT_INITIALIZED: |
|
170 User::Leave(KErrNotSupported); |
|
171 } |
|
172 } |
|
173 HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - EGL Initialized. EGL Version %i.%i"), majorVersion, minorVersion); |
|
174 CHuiStatic::Env().GlesRefCounter()++; |
|
175 |
|
176 // Indicate that we are going to use OpenVG for our drawing |
|
177 eglBindAPI(EGL_OPENVG_API); |
|
178 } |
|
179 |
|
180 #ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
181 if (iDefaultRenderSurface != NULL) |
|
182 { |
|
183 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Restoring default rendering surface..") ); |
|
184 iDefaultRenderSurface->RestoreL(); |
|
185 iDefaultRenderSurface->MakeCurrent(); |
|
186 } |
|
187 #endif |
|
188 |
|
189 iStateFlags = 0; |
|
190 #ifdef __NVG |
|
191 iNvgEngine = CNvgEngine::NewL(); |
|
192 // Set the image binder for NVG-TLV special case "Group opacity" |
|
193 iMVGImageBinder = CHuiVg10VgImageBinder::NewL(this); |
|
194 iNvgEngine->SetVGImageBinder(iMVGImageBinder); |
|
195 #endif |
|
196 HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Renderer restored!") ); |
|
197 |
|
198 } |
|
199 |
|
200 void CHuiVg10RenderPlugin::Release() |
|
201 { |
|
202 #ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
203 if (iDefaultRenderSurface != NULL) |
|
204 { |
|
205 HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Releasing default rendering surface..") ); |
|
206 iDefaultRenderSurface->Release(); |
|
207 } |
|
208 #endif |
|
209 // Uninitialize EGL. |
|
210 if (--CHuiStatic::Env().GlesRefCounter() == 0) |
|
211 { |
|
212 HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Uninitializing EGL.")); |
|
213 eglMakeCurrent(iEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
|
214 eglTerminate(iEglDisplay); |
|
215 eglReleaseThread(); |
|
216 iEglDisplay = 0; |
|
217 } |
|
218 #ifdef __NVG |
|
219 delete iNvgEngine; |
|
220 iNvgEngine = NULL; |
|
221 delete iMVGImageBinder; |
|
222 iMVGImageBinder = NULL; |
|
223 #endif |
|
224 HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Renderer released.")); |
|
225 } |
|
226 |
|
227 |
|
228 TBool CHuiVg10RenderPlugin::Allows(THuiRenderPluginAllow aAllow) const |
|
229 { |
|
230 switch(aAllow) |
|
231 { |
|
232 case EHuiRenderPluginAllowTextureModeInterpolate: |
|
233 // OpenVG does not support texture interpolation. |
|
234 return EFalse; |
|
235 #ifdef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
236 case EHuiRenderPluginAllowPBufferSurfaces: |
|
237 return EFalse; |
|
238 #endif |
|
239 case EHuiRenderPluginAllowSwapBufferPreserve: |
|
240 return iAllowsSwapBufferPreserved; |
|
241 case EHuiRenderPluginAllowVisualPBufferSurfaces: |
|
242 return iAllowsVisualPBufferSurfaces; |
|
243 default: |
|
244 return ETrue; |
|
245 } |
|
246 } |
|
247 |
|
248 |
|
249 MHuiRenderSurface* CHuiVg10RenderPlugin::CreateRenderSurfaceL(CHuiDisplay& aDisplay) |
|
250 { |
|
251 return CHuiVg10RenderSurface::NewL(aDisplay); |
|
252 } |
|
253 |
|
254 |
|
255 CHuiVg10PBufferSurface* CHuiVg10RenderPlugin::CreatePBufferSurfaceL(TSize aSize, TInt aEglBufferType, TInt aBufferColorMode) |
|
256 { |
|
257 CHuiVg10PBufferSurface* surface = CHuiVg10PBufferSurface::NewLC(*this, aSize, 0, aEglBufferType, aBufferColorMode); |
|
258 CleanupStack::Pop(surface); |
|
259 return surface; |
|
260 } |
|
261 |
|
262 |
|
263 CHuiGc* CHuiVg10RenderPlugin::CreateGcL() |
|
264 { |
|
265 return CHuiVg10Gc::NewL(); |
|
266 } |
|
267 |
|
268 |
|
269 CHuiTexture* CHuiVg10RenderPlugin::CreateTextureL(const THuiTextureHandle* aExistingTexture) |
|
270 { |
|
271 return CHuiVg10Texture::NewL(*this, aExistingTexture); |
|
272 } |
|
273 |
|
274 CHuiTextureManager* CHuiVg10RenderPlugin::CreateTextureManagerL(CHuiEnv& aEnv) |
|
275 { |
|
276 return CHuiVg10TextureManager::NewL(aEnv); |
|
277 } |
|
278 |
|
279 |
|
280 CHuiMesh* CHuiVg10RenderPlugin::CreateMeshL(THuiMeshType aMeshType) |
|
281 { |
|
282 CHuiMesh* ret = NULL; |
|
283 |
|
284 switch(aMeshType) |
|
285 { |
|
286 default: |
|
287 User::Leave(KErrNotSupported); |
|
288 break; |
|
289 } |
|
290 |
|
291 return ret; |
|
292 } |
|
293 |
|
294 |
|
295 CHuiTextMesh* CHuiVg10RenderPlugin::CreateTextMeshL() |
|
296 { |
|
297 return CHuiRasterizedTextMesh::NewL(); |
|
298 } |
|
299 |
|
300 |
|
301 CHuiCurvePath* CHuiVg10RenderPlugin::CreateCurvePathL() |
|
302 { |
|
303 CHuiVg10CurvePath* curve = new (ELeave) CHuiVg10CurvePath(); |
|
304 CleanupStack::PushL(curve); |
|
305 curve->ConstructL(); |
|
306 CleanupStack::Pop(curve); |
|
307 return curve; |
|
308 } |
|
309 |
|
310 |
|
311 void CHuiVg10RenderPlugin::DeleteNamedTexture(TUint aName) |
|
312 { |
|
313 (void)aName; |
|
314 } |
|
315 |
|
316 |
|
317 #ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE |
|
318 void CHuiVg10RenderPlugin::NotifyDisplayCountL(TUint aCount) |
|
319 { |
|
320 if( aCount == 0 ) |
|
321 { |
|
322 // No current display available in the environment. |
|
323 // Make default surface current to be able to continue resource loading. |
|
324 iDefaultRenderSurface->MakeCurrent(); |
|
325 } |
|
326 } |
|
327 #else |
|
328 void CHuiVg10RenderPlugin::NotifyDisplayCountL(TUint /*aCount*/) |
|
329 { |
|
330 } |
|
331 #endif |
|
332 |
|
333 EGLConfig CHuiVg10RenderPlugin::EglDisplay() |
|
334 { |
|
335 return iEglDisplay; |
|
336 } |
|
337 |
|
338 |
|
339 EGLContext CHuiVg10RenderPlugin::EglSharedContext() const |
|
340 { |
|
341 return iSharedContext; |
|
342 } |
|
343 |
|
344 |
|
345 void CHuiVg10RenderPlugin::EglSetSharedContext(EGLContext aContext) |
|
346 { |
|
347 iSharedContext = aContext; |
|
348 } |
|
349 |
|
350 |
|
351 TInt CHuiVg10RenderPlugin::EglChooseConfig(const TInt* aAttribList) |
|
352 { |
|
353 EGLint numOfConfigs = 0; |
|
354 if(eglChooseConfig(iEglDisplay, aAttribList, iConfigs, KVg10ConfigsCount, |
|
355 &numOfConfigs) == EGL_FALSE) |
|
356 { |
|
357 return 0; |
|
358 } |
|
359 return numOfConfigs; |
|
360 } |
|
361 |
|
362 |
|
363 TInt CHuiVg10RenderPlugin::EglConfig(TInt aIndex) |
|
364 { |
|
365 if(aIndex < 0 || aIndex >= KVg10ConfigsCount) |
|
366 { |
|
367 THuiPanic::Panic(THuiPanic::EEnvConfigNotFound); |
|
368 } |
|
369 return iConfigs[aIndex]; |
|
370 } |
|
371 |
|
372 |
|
373 void CHuiVg10RenderPlugin::EglPrintConfig(TInt aIndex) |
|
374 { |
|
375 if(aIndex < 0 || aIndex >= KVg10ConfigsCount) |
|
376 { |
|
377 THuiPanic::Panic(THuiPanic::EEnvConfigNotFound); |
|
378 } |
|
379 |
|
380 EGLint value; |
|
381 EGLConfig cfg = iConfigs[aIndex]; |
|
382 |
|
383 CHuiStatic::Printf(_L("EGL Configuration %i:"), aIndex); |
|
384 |
|
385 #ifdef WIN32 |
|
386 #define HUI_PRINT_EGL_ATTRIB(aAttr) \ |
|
387 eglGetConfigAttrib(iEglDisplay, cfg, aAttr, &value); \ |
|
388 CHuiStatic::Printf(_L(#aAttr " = %i (%04x)"), value, value); |
|
389 #else |
|
390 #define HUI_PRINT_EGL_ATTRIB(aAttr) \ |
|
391 eglGetConfigAttrib(iEglDisplay, cfg, aAttr, &value); \ |
|
392 CHuiStatic::Printf(_L("Parameter (id %04x):"), aAttr); \ |
|
393 CHuiStatic::Printf(_L8(#aAttr)); \ |
|
394 CHuiStatic::Printf(_L("Value: %i (%04x)"), value, value); |
|
395 #endif |
|
396 HUI_PRINT_EGL_ATTRIB(EGL_CONFIG_ID); |
|
397 HUI_PRINT_EGL_ATTRIB(EGL_CONFIG_CAVEAT); |
|
398 HUI_PRINT_EGL_ATTRIB(EGL_SURFACE_TYPE); |
|
399 HUI_PRINT_EGL_ATTRIB(EGL_BUFFER_SIZE); |
|
400 HUI_PRINT_EGL_ATTRIB(EGL_RED_SIZE); |
|
401 HUI_PRINT_EGL_ATTRIB(EGL_GREEN_SIZE); |
|
402 HUI_PRINT_EGL_ATTRIB(EGL_BLUE_SIZE); |
|
403 HUI_PRINT_EGL_ATTRIB(EGL_ALPHA_SIZE); |
|
404 HUI_PRINT_EGL_ATTRIB(EGL_DEPTH_SIZE); |
|
405 HUI_PRINT_EGL_ATTRIB(EGL_LEVEL); |
|
406 HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_WIDTH); |
|
407 HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_HEIGHT); |
|
408 HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_PIXELS); |
|
409 HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_RENDERABLE); |
|
410 HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_VISUAL_ID); |
|
411 HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_VISUAL_TYPE); |
|
412 HUI_PRINT_EGL_ATTRIB(EGL_SAMPLE_BUFFERS); |
|
413 HUI_PRINT_EGL_ATTRIB(EGL_SAMPLES); |
|
414 HUI_PRINT_EGL_ATTRIB(EGL_STENCIL_SIZE); |
|
415 HUI_PRINT_EGL_ATTRIB(EGL_TRANSPARENT_TYPE); |
|
416 #ifdef EGL_VERSION_1_1 |
|
417 HUI_PRINT_EGL_ATTRIB(EGL_BIND_TO_TEXTURE_RGB); |
|
418 HUI_PRINT_EGL_ATTRIB(EGL_BIND_TO_TEXTURE_RGBA); |
|
419 HUI_PRINT_EGL_ATTRIB(EGL_MAX_SWAP_INTERVAL); |
|
420 HUI_PRINT_EGL_ATTRIB(EGL_MIN_SWAP_INTERVAL); |
|
421 #endif |
|
422 #ifdef EGL_VERSION_1_2 |
|
423 HUI_PRINT_EGL_ATTRIB(EGL_PRESERVED_RESOURCES); |
|
424 HUI_PRINT_EGL_ATTRIB(EGL_LUMINANCE_SIZE); |
|
425 HUI_PRINT_EGL_ATTRIB(EGL_ALPHA_MASK_SIZE); |
|
426 HUI_PRINT_EGL_ATTRIB(EGL_COLOR_BUFFER_TYPE); |
|
427 HUI_PRINT_EGL_ATTRIB(EGL_RENDERABLE_TYPE); |
|
428 #endif |
|
429 |
|
430 #undef HUI_PRINT_EGL_ATTRIB |
|
431 } |
|
432 |
|
433 |
|
434 TBool CHuiVg10RenderPlugin::IsReleased() const |
|
435 { |
|
436 if(CHuiStatic::Env().GlesRefCounter() == 0) |
|
437 { |
|
438 return ETrue; |
|
439 } |
|
440 return EFalse; |
|
441 } |
|
442 |
|
443 const TDesC& CHuiVg10RenderPlugin::VgErrorMessage(VGErrorCode aErrorCode) |
|
444 { |
|
445 // Error messages. |
|
446 _LIT(KGlesErrorUnknown, "Invalid or unknown error."); |
|
447 |
|
448 switch(aErrorCode) |
|
449 { |
|
450 default: |
|
451 return KGlesErrorUnknown; |
|
452 } |
|
453 } |
|
454 |
|
455 |
|
456 VGErrorCode CHuiVg10RenderPlugin::VgError() |
|
457 { |
|
458 VGErrorCode error = vgGetError(); |
|
459 #ifdef _DEBUG |
|
460 // Print the vgError always in debug mode, not just when HUI_DEBUG is in use |
|
461 if (error != VG_NO_ERROR) |
|
462 { |
|
463 RDebug::Print(_L("CHuiVg10RenderPlugin::VgError -- %04x"), error); |
|
464 } |
|
465 #endif |
|
466 return error; |
|
467 } |
|
468 |
|
469 |
|
470 TBool CHuiVg10RenderPlugin::IsHardwareAccelerated() |
|
471 { |
|
472 // consider vg10 plugin as HW accelerated until a better check |
|
473 |
|
474 // TBool HWFound = EFalse; |
|
475 iIsHardwareAccelerated = ETrue; |
|
476 return ETrue; |
|
477 } |
|
478 |
|
479 CHuiCanvasGc* CHuiVg10RenderPlugin::CreateCanvasGcL() |
|
480 { |
|
481 return new (ELeave) CHuiVg10CanvasGc(); |
|
482 } |
|
483 |
|
484 CHuiFxEngine* CHuiVg10RenderPlugin::CreateEffectsEngineL() |
|
485 { |
|
486 return CHuiFxVg10Engine::NewL(*this); |
|
487 } |
|
488 |
|
489 void CHuiVg10RenderPlugin::AddRestoreStateFlags(TInt aFlags) |
|
490 { |
|
491 iStateFlags |= aFlags; |
|
492 } |
|
493 |
|
494 TInt CHuiVg10RenderPlugin::GetRestoreStateFlags() |
|
495 { |
|
496 return iStateFlags; |
|
497 } |
|
498 |
|
499 void CHuiVg10RenderPlugin::ClearRestoreStateFlags() |
|
500 { |
|
501 iStateFlags &= 0x00000000; |
|
502 } |
|
503 |
|
504 #ifdef __NVG |
|
505 CNvgEngine& CHuiVg10RenderPlugin::NvgEngine() const |
|
506 { |
|
507 return *iNvgEngine; |
|
508 } |
|
509 #endif |
|
510 |
|
511 // TODO: This is only a temporary check until all HW platforms support feature |
|
512 void CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() |
|
513 { |
|
514 #ifdef __WINS__ |
|
515 iAllowsSwapBufferPreserved = ETrue; |
|
516 #else |
|
517 const char* vendor = eglQueryString(iEglDisplay, EGL_VENDOR); |
|
518 //const VGubyte* vendor = vgGetString(VG_VENDOR); |
|
519 //RDebug::Print(_L("vendor = %s"), vendor); |
|
520 |
|
521 TBool found = EFalse; |
|
522 if( vendor[0] != 0 && vendor[0] == 'B' && vendor[1] == 'r') |
|
523 { |
|
524 RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() -- ETrue")); |
|
525 found = ETrue; |
|
526 } |
|
527 else |
|
528 { |
|
529 RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() -- EFalse")); |
|
530 } |
|
531 iAllowsSwapBufferPreserved = found; |
|
532 #endif |
|
533 } |
|
534 |
|
535 // TODO: This is only a temporary check until all HW platforms support feature |
|
536 void CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces() |
|
537 { |
|
538 #ifdef __WINS__ |
|
539 iAllowsVisualPBufferSurfaces = ETrue; |
|
540 #else |
|
541 const char* vendor = eglQueryString(iEglDisplay, EGL_VENDOR); |
|
542 //const VGubyte* vendor = vgGetString(VG_VENDOR); |
|
543 //RDebug::Print(_L("vendor = %s"), vendor); |
|
544 |
|
545 TBool found = EFalse; |
|
546 if( vendor[0] != 0 && vendor[0] == 'B' && vendor[1] == 'r') |
|
547 { |
|
548 RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces() -- ETrue")); |
|
549 found = ETrue; |
|
550 } |
|
551 else |
|
552 { |
|
553 RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces() -- EFalse")); |
|
554 } |
|
555 iAllowsVisualPBufferSurfaces = found; |
|
556 #endif |
|
557 } |
|
558 |