uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp
branchRCL_3
changeset 52 31fccae4f8a7
parent 51 e5af45d51884
--- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp	Tue Aug 31 16:07:35 2010 +0300
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp	Wed Sep 01 12:16:53 2010 +0100
@@ -565,3 +565,23 @@
 #endif
     }
 
+
+EGLSurface CHuiVg10RenderPlugin::CreatePBufferSurface(EGLDisplay aDisplay,
+            EGLenum aBuffertype, EGLClientBuffer aBuffer, EGLConfig aConfig)
+    {
+    EGLSurface newSurface = EGL_NO_SURFACE;
+    newSurface = eglCreatePbufferFromClientBuffer(aDisplay, aBuffertype, aBuffer, aConfig, NULL);
+
+    // if oom condition, free all the cached memory and try again
+    if(newSurface == EGL_NO_SURFACE)
+        {
+        if(eglGetError() == EGL_BAD_ALLOC)
+            {
+            CHuiEnv* env = CHuiEnv::Static();  
+            env->HandleOutOfTextureMemory();
+            newSurface = eglCreatePbufferFromClientBuffer(aDisplay, aBuffertype, aBuffer, aConfig, NULL);
+            }
+        }
+    return newSurface;
+    }
+