Ensure we discard unneeded renderbuffers in OpenGL ES 2.0 as well
[platform/core/uifw/dali-adaptor.git] / adaptors / common / gl / gl-implementation.h
index 7c7b802..36a08cc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_GL_IMPLEMENTATION_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@
 #error "OpenGL ES version not specified"
 #endif
 
-#if DALI_GLES_VERSION >= 30
+#if DALI_GLES_VERSION >= 31
+#include <GLES3/gl31.h>
+#elif DALI_GLES_VERSION >= 30
 #include <GLES3/gl3.h>
 #else
 #include <cstdlib>
@@ -60,7 +62,7 @@ public:
     /* Do nothing in main implementation */
   }
 
-  void PostRender( unsigned int timeDelta )
+  void PostRender()
   {
     /* Do nothing in main implementation */
   }
@@ -1481,6 +1483,8 @@ public:
     // if OpenGL ES 2.0 compatibility is need this can be implemented with
     // glGetProgramBinaryOES
     glGetProgramBinary(program,bufSize,length,binaryFormat,binary);
+#else
+    mGlExtensions.GetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
 #endif // DALI_GLES_VERSION >= 30
   }
 
@@ -1490,6 +1494,8 @@ public:
     // if OpenGL ES 2.0 compatibility is need this can be implemented with
     // glProgramBinaryOES
     glProgramBinary(program,binaryFormat,binary,length);
+#else
+    mGlExtensions.ProgramBinaryOES(program, binaryFormat, binary, length);
 #endif // DALI_GLES_VERSION >= 30
   }
 
@@ -1503,9 +1509,9 @@ public:
   void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
   {
 #if DALI_GLES_VERSION >= 30
-    // if OpenGL ES 2.0 compatibility is need this can be implemented with
-    // glDiscardFramebufferEXT
     glInvalidateFramebuffer(target,numAttachments,attachments);
+#else
+    mGlExtensions.DiscardFrameBuffer(target, numAttachments, attachments);
 #endif // DALI_GLES_VERSION >= 30
   }