/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <dali/internal/graphics/gles/gl-extensions.h>
// EXTERNAL INCLUDES
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
+#include <dali/internal/graphics/common/egl-include.h>
+// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
namespace Dali
namespace Adaptor
{
-namespace ECoreX
-{
-
GlExtensions::GlExtensions()
:
-#if DALI_GLES_VERSION < 30
#ifdef GL_EXT_discard_framebuffer
- mGlDiscardFramebuffer( NULL ),
+ mGlDiscardFramebuffer( nullptr ),
#endif
#ifdef GL_OES_get_program_binary
- mGlGetProgramBinaryOES( NULL ),
- mGlProgramBinaryOES( NULL ),
+ mGlGetProgramBinaryOES( nullptr ),
+ mGlProgramBinaryOES( nullptr ),
+#endif
+#ifdef GL_KHR_blend_equation_advanced
+ mBlendBarrierKHR( nullptr ),
#endif
-#endif // DALI_GLES_VERSION < 30
mInitialized( false )
{
}
{
}
-#if DALI_GLES_VERSION < 30
-
void GlExtensions::DiscardFrameBuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments)
{
// initialize extension on first use as on some hw platforms a context
#endif
}
+bool GlExtensions::BlendBarrierKHR()
+{
+ // initialize extension on first use as on some hw platforms a context
+ // has to be bound for the extensions to return correct pointer
+ if( !mInitialized )
+ {
+ Initialize();
+ }
+
+#ifdef GL_KHR_blend_equation_advanced
+ if (mBlendBarrierKHR)
+ {
+ mBlendBarrierKHR();
+ return true;
+ }
+ return false;
+#endif
+
+ return false;
+}
+
void GlExtensions::Initialize()
{
mInitialized = true;
mGlGetProgramBinaryOES = reinterpret_cast< PFNGLGETPROGRAMBINARYOESPROC >( eglGetProcAddress("glGetProgramBinaryOES") );
mGlProgramBinaryOES = reinterpret_cast< PFNGLPROGRAMBINARYOESPROC >( eglGetProcAddress("glProgramBinaryOES") );
#endif
-}
-
-#endif // DALI_GLES_VERSION < 30
-} // namespace ECoreX
+#ifdef GL_KHR_blend_equation_advanced
+ mBlendBarrierKHR = reinterpret_cast< PFNGLBLENDBARRIERKHRPROC >( eglGetProcAddress("glBlendBarrierKHR") );
+#endif
+}
} // namespace Adaptor