Index: src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp |
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp |
index 6adaf1964fc13b244bf7dddc4a01ea234a054f6b..d63dfbbcd63edf3bd6cd9f3f8f1f5a884e930f0a 100644 |
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp |
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp |
@@ -8,9 +8,21 @@ |
#include "gl/GrGLInterface.h" |
#include "gl/GrGLAssembleInterface.h" |
+#include "gl/GrGLUtil.h" |
#define WIN32_LEAN_AND_MEAN |
#include <windows.h> |
+#include <GL/gl.h> |
+ |
+#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" |
+ |
class AutoLibraryUnload { |
public: |
AutoLibraryUnload(const char* moduleName) { |
@@ -70,5 +82,13 @@ const GrGLInterface* GrGLCreateNativeInterface() { |
return NULL; |
} |
- return GrGLAssembleGLInterface(&getter, win_get_gl_proc); |
+ const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION)); |
+ GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); |
+ |
+ if (kGLES_GrGLStandard == standard) { |
+ return GrGLAssembleGLESInterface(&getter, win_get_gl_proc); |
+ } else if (kGL_GrGLStandard == standard) { |
+ return GrGLAssembleGLInterface(&getter, win_get_gl_proc); |
+ } |
+ return NULL; |
} |