Temporarily disable viewport caching in GL context 72/202872/1
authorRichard Huang <r.huang@samsung.com>
Fri, 5 Apr 2019 09:43:56 +0000 (10:43 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 5 Apr 2019 09:43:56 +0000 (10:43 +0100)
Change-Id: I5d6bdf82d3cea8c6e40f5b62c7d263b49f2ae86b

dali/internal/render/common/render-manager.cpp
dali/internal/render/gl-resources/context.h

index a69d02f..2d4d9e8 100644 (file)
@@ -586,16 +586,23 @@ void RenderManager::DoRender( RenderInstruction& instruction )
   {
     instruction.mFrameBuffer->Bind( *mImpl->currentContext );
   }
+  else
+  {
+    mImpl->currentContext->BindFramebuffer( GL_FRAMEBUFFER, 0u );
+  }
 
-  mImpl->currentContext->Viewport( surfaceRect.x,
-                            surfaceRect.y,
-                            surfaceRect.width,
-                            surfaceRect.height );
-
-  mImpl->currentContext->ClearColor( backgroundColor.r,
-                              backgroundColor.g,
-                              backgroundColor.b,
-                              backgroundColor.a );
+  if ( surfaceFrameBuffer )
+  {
+    mImpl->currentContext->Viewport( surfaceRect.x,
+                              surfaceRect.y,
+                              surfaceRect.width,
+                              surfaceRect.height );
+
+    mImpl->currentContext->ClearColor( backgroundColor.r,
+                                backgroundColor.g,
+                                backgroundColor.b,
+                                backgroundColor.a );
+  }
 
   // Clear the entire color, depth and stencil buffers for the default framebuffer, if required.
   // It is important to clear all 3 buffers when they are being used, for performance on deferred renderers
index 81561ba..e758632 100644 (file)
@@ -1635,7 +1635,11 @@ public:
   {
     // check if its same as already set
     Rect<int> newViewport( x, y, width, height );
-    if( mViewPort != newViewport )
+
+    // Temporarily disable the viewport caching, as the implementation of GLES driver in Tizen platform
+    // share a global viewport between multiple contexts, therefore glViewport has to be called every
+    // time after glBindFramebuffer regardless of the same vewport size in the same context.
+//    if( mViewPort != newViewport )
     {
       // set new one
       LOG_GL("Viewport %d %d %d %d\n", x, y, width, height);