{
// Tell surface we have stopped rendering
mSurface->StopRender();
-
- // The surface will be destroyed soon; this pointer will become invalid
- mSurface = NULL;
}
}
{
// give a chance to destroy the OpenGL surface that created externally
mSurface->DestroyEglSurface( *mEGL );
+
+ mSurface = NULL;
}
// delete the GL context / egl surface
return true;
}
-void RenderHelper::PostRender()
+void RenderHelper::PostRender( bool renderToFbo )
{
// Inform the gl implementation that rendering has finished before informing the surface
mGLES.PostRender();
- if( mSurface )
+ if( renderToFbo )
+ {
+ mGLES.Flush();
+ mGLES.Finish();
+ }
+ else
{
- // Inform the surface that rendering this frame has finished.
- mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
+ if( mSurface )
+ {
+ // Inform the surface that rendering this frame has finished.
+ mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
+ }
}
mSurfaceReplaced = false;
mSurfaceResized = false;