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

Side by Side Diff: src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase 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
« no previous file with comments | « src/gpu/gl/android/SkNativeGLContext_android.cpp ('k') | src/gpu/gl/angle/SkANGLEGLContext.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 2012 Google Inc. 3 * Copyright 2012 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 9
10 #include "gl/GrGLInterface.h" 10 #include "gl/GrGLInterface.h"
11 #include "gl/GrGLAssembleInterface.h" 11 #include "gl/GrGLAssembleInterface.h"
12 12
13 #define WIN32_LEAN_AND_MEAN 13 #define WIN32_LEAN_AND_MEAN
14 #include <windows.h> 14 #include <windows.h>
15 #include "EGL/egl.h" 15 #include "EGL/egl.h"
16 16
17 static GrGLFuncPtr angle_get_gl_proc(void* ctx, const char name[]) { 17 static GrGLFuncPtr angle_get_gl_proc(void* ctx, const char name[]) {
18 GrGLFuncPtr proc = (GrGLFuncPtr) GetProcAddress((HMODULE)ctx, name); 18 GrGLFuncPtr proc = (GrGLFuncPtr) GetProcAddress((HMODULE)ctx, name);
19 if (NULL != proc) { 19 if (proc) {
20 return proc; 20 return proc;
21 } 21 }
22 return eglGetProcAddress(name); 22 return eglGetProcAddress(name);
23 } 23 }
24 24
25 const GrGLInterface* GrGLCreateANGLEInterface() { 25 const GrGLInterface* GrGLCreateANGLEInterface() {
26 26
27 static HMODULE ghANGLELib = NULL; 27 static HMODULE ghANGLELib = NULL;
28 28
29 if (NULL == ghANGLELib) { 29 if (NULL == ghANGLELib) {
30 // We load the ANGLE library and never let it go 30 // We load the ANGLE library and never let it go
31 ghANGLELib = LoadLibrary("libGLESv2.dll"); 31 ghANGLELib = LoadLibrary("libGLESv2.dll");
32 } 32 }
33 if (NULL == ghANGLELib) { 33 if (NULL == ghANGLELib) {
34 // We can't setup the interface correctly w/o the DLL 34 // We can't setup the interface correctly w/o the DLL
35 return NULL; 35 return NULL;
36 } 36 }
37 37
38 return GrGLAssembleGLESInterface(ghANGLELib, angle_get_gl_proc); 38 return GrGLAssembleGLESInterface(ghANGLELib, angle_get_gl_proc);
39 } 39 }
OLDNEW
« no previous file with comments | « src/gpu/gl/android/SkNativeGLContext_android.cpp ('k') | src/gpu/gl/angle/SkANGLEGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698