uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp
branchRCL_3
changeset 18 1801340c26a2
parent 9 3ac8bf5c5014
child 19 e5af45d51884
--- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp	Thu Jul 15 19:40:07 2010 +0300
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp	Thu Aug 19 10:48:02 2010 +0300
@@ -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;
+    }
+