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

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

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « src/gpu/gl/unix/SkNativeGLContext_unix.cpp ('k') | src/gpu/gl/win/SkNativeGLContext_win.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
12 #define WIN32_LEAN_AND_MEAN 11 #define WIN32_LEAN_AND_MEAN
13 #include <windows.h> 12 #include <windows.h>
14 13
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 #define USE_LINKED 0
24
25 #include "gl/GrGLAssembleGLESInterface.h"
26
27 class AutoLibraryUnload { 14 class AutoLibraryUnload {
28 public: 15 public:
29 AutoLibraryUnload(const char* moduleName) { 16 AutoLibraryUnload(const char* moduleName) {
30 fModule = LoadLibrary(moduleName); 17 fModule = LoadLibrary(moduleName);
31 } 18 }
32 ~AutoLibraryUnload() { 19 ~AutoLibraryUnload() {
33 if (NULL != fModule) { 20 if (NULL != fModule) {
34 FreeLibrary(fModule); 21 FreeLibrary(fModule);
35 } 22 }
36 } 23 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const GrGLInterface* GrGLCreateNativeInterface() { 63 const GrGLInterface* GrGLCreateNativeInterface() {
77 if (NULL == wglGetCurrentContext()) { 64 if (NULL == wglGetCurrentContext()) {
78 return NULL; 65 return NULL;
79 } 66 }
80 67
81 GLProcGetter getter; 68 GLProcGetter getter;
82 if (!getter.isInitialized()) { 69 if (!getter.isInitialized()) {
83 return NULL; 70 return NULL;
84 } 71 }
85 72
86 const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION )); 73 return GrGLAssembleGLInterface(&getter, win_get_gl_proc);
87 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
88
89 if (kGLES_GrGLStandard == standard) {
90 return GrGLAssembleGLESInterface(&getter, win_get_gl_proc);
91 } else if (kGL_GrGLStandard == standard) {
92 return GrGLAssembleGLInterface(&getter, win_get_gl_proc);
93 }
94 return NULL;
95 } 74 }
OLDNEW
« no previous file with comments | « src/gpu/gl/unix/SkNativeGLContext_unix.cpp ('k') | src/gpu/gl/win/SkNativeGLContext_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698