X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fskia%2Fsrc%2Fgpu%2Fgl%2Funix%2FGrGLCreateNativeInterface_unix.cpp;h=b3c7a3c5a9d1f1e67c12dba983808bb34a1c9e4a;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=ddbfe5de294d693a16836bf72415c813fd80e980;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/third_party/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp index ddbfe5d..b3c7a3c 100644 --- a/src/third_party/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp +++ b/src/third_party/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp @@ -8,9 +8,19 @@ #include "gl/GrGLInterface.h" #include "gl/GrGLAssembleInterface.h" +#include "gl/GrGLUtil.h" #include +#define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F) +#define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F #S) +#define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl" #F) + +#define GET_LINKED GET_PROC +#define GET_LINKED_SUFFIX GET_PROC_SUFFIX + +#include "gl/GrGLAssembleGLESInterface.h" + static GrGLFuncPtr glx_get(void* ctx, const char name[]) { SkASSERT(NULL == ctx); SkASSERT(NULL != glXGetCurrentContext()); @@ -21,5 +31,14 @@ const GrGLInterface* GrGLCreateNativeInterface() { if (NULL == glXGetCurrentContext()) { return NULL; } - return GrGLAssembleGLInterface(NULL, glx_get); + + const char* verStr = reinterpret_cast(glGetString(GR_GL_VERSION)); + GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); + + if (kGLES_GrGLStandard == standard) { + return GrGLAssembleGLESInterface(NULL, glx_get); + } else if (kGL_GrGLStandard == standard) { + return GrGLAssembleGLInterface(NULL, glx_get); + } + return NULL; }