X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles%2Fgl-extensions.cpp;h=f61d9ddcc67edb41415fb60e9a79532c5b47476e;hb=dc748492c6f7eba549b6fee365181ffc0b8473d3;hp=3cc449a7812517cb185a1dc569cca6bc1ba99de5;hpb=6615c344f7515fa67e8d8b769290fef5140d8e9a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/gles/gl-extensions.cpp b/dali/internal/graphics/gles/gl-extensions.cpp index 3cc449a..f61d9dd 100644 --- a/dali/internal/graphics/gles/gl-extensions.cpp +++ b/dali/internal/graphics/gles/gl-extensions.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -19,9 +19,9 @@ #include // EXTERNAL INCLUDES -#include -#include +#include +// INTERNAL INCLUDES #include namespace Dali @@ -33,20 +33,18 @@ namespace Internal 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 ) { } @@ -55,8 +53,6 @@ GlExtensions::~GlExtensions() { } -#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 @@ -122,6 +118,27 @@ void GlExtensions::ProgramBinaryOES(GLuint program, GLenum binaryFormat, const G #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; @@ -134,11 +151,11 @@ void GlExtensions::Initialize() 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