Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp

Issue 500153002: Remove reliance on linked in GL functions for assembling GLES interfaces (Closed) Base URL: https://skia.googlesource.com/skia.git@gmcfg
Patch Set: cleanup Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "gl/GrGLInterface.h" 9 #include "gl/GrGLInterface.h"
10 #include "gl/GrGLAssembleInterface.h" 10 #include "gl/GrGLAssembleInterface.h"
11 #include "gl/GrGLUtil.h" 11 #include "gl/GrGLUtil.h"
12 #define WIN32_LEAN_AND_MEAN 12 #define WIN32_LEAN_AND_MEAN
13 #include <windows.h> 13 #include <windows.h>
14 14
15 #include <GL/gl.h>
16
17 #define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F)
18 #define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, " gl" #F #S)
19 #define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl " #F)
20
21 #define GET_LINKED GET_PROC
22 #define GET_LINKED_SUFFIX GET_PROC_SUFFIX
23
24 #include "gl/GrGLAssembleGLESInterface.h"
25
26 class AutoLibraryUnload { 15 class AutoLibraryUnload {
27 public: 16 public:
28 AutoLibraryUnload(const char* moduleName) { 17 AutoLibraryUnload(const char* moduleName) {
29 fModule = LoadLibrary(moduleName); 18 fModule = LoadLibrary(moduleName);
30 } 19 }
31 ~AutoLibraryUnload() { 20 ~AutoLibraryUnload() {
32 if (NULL != fModule) { 21 if (NULL != fModule) {
33 FreeLibrary(fModule); 22 FreeLibrary(fModule);
34 } 23 }
35 } 24 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const char* verStr = reinterpret_cast<const char*>(getString(GR_GL_VERSION)) ; 78 const char* verStr = reinterpret_cast<const char*>(getString(GR_GL_VERSION)) ;
90 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); 79 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
91 80
92 if (kGLES_GrGLStandard == standard) { 81 if (kGLES_GrGLStandard == standard) {
93 return GrGLAssembleGLESInterface(&getter, win_get_gl_proc); 82 return GrGLAssembleGLESInterface(&getter, win_get_gl_proc);
94 } else if (kGL_GrGLStandard == standard) { 83 } else if (kGL_GrGLStandard == standard) {
95 return GrGLAssembleGLInterface(&getter, win_get_gl_proc); 84 return GrGLAssembleGLInterface(&getter, win_get_gl_proc);
96 } 85 }
97 return NULL; 86 return NULL;
98 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698