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

Side by Side Diff: src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp

Issue 133073009: Move GrGLInterface function pointers into a nested struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tip of tree Created 6 years, 11 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 | Annotate | Revision Log
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 9
10 #include "gl/GrGLInterface.h" 10 #include "gl/GrGLInterface.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 private: 32 private:
33 void* fLibrary; 33 void* fLibrary;
34 }; 34 };
35 35
36 static void* GetProcAddress(const char* name) { 36 static void* GetProcAddress(const char* name) {
37 static GLLoader gLoader; 37 static GLLoader gLoader;
38 return dlsym(gLoader.handle(), name); 38 return dlsym(gLoader.handle(), name);
39 } 39 }
40 40
41 #define GET_PROC(name) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAd dress("gl" #name))) 41 #define GET_PROC(name) (interface->fFunctions.f ## name = ((GrGL ## name ## Proc ) GetProcAddress("gl" #name)))
42 #define GET_PROC_SUFFIX(name, suffix) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name #suffix))) 42 #define GET_PROC_SUFFIX(name, suffix) (interface->fFunctions.f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name #suffix)))
43 43
44 const GrGLInterface* GrGLCreateNativeInterface() { 44 const GrGLInterface* GrGLCreateNativeInterface() {
45 45
46 GrGLGetStringProc glGetString = (GrGLGetStringProc) GetProcAddress("glGetStr ing"); 46 GrGLGetStringProc glGetString = (GrGLGetStringProc) GetProcAddress("glGetStr ing");
47 GrGLGetStringiProc glGetStringi = (GrGLGetStringiProc) GetProcAddress("glGet Stringi"); 47 GrGLGetStringiProc glGetStringi = (GrGLGetStringiProc) GetProcAddress("glGet Stringi");
48 GrGLGetIntegervProc glGetIntegerv = (GrGLGetIntegervProc) GetProcAddress("gl GetIntegerv"); 48 GrGLGetIntegervProc glGetIntegerv = (GrGLGetIntegervProc) GetProcAddress("gl GetIntegerv");
49 49
50 const char* verStr = (const char*) glGetString(GR_GL_VERSION); 50 const char* verStr = (const char*) glGetString(GR_GL_VERSION);
51 GrGLVersion ver = GrGLGetVersionFromString(verStr); 51 GrGLVersion ver = GrGLGetVersionFromString(verStr);
52 GrGLExtensions extensions; 52 GrGLExtensions extensions;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 } 238 }
239 if (ver >= GR_GL_VER(3,3) || extensions.has("GL_ARB_blend_func_extended")) { 239 if (ver >= GR_GL_VER(3,3) || extensions.has("GL_ARB_blend_func_extended")) {
240 // ARB extension doesn't use the ARB suffix on the function name 240 // ARB extension doesn't use the ARB suffix on the function name
241 GET_PROC(BindFragDataLocationIndexed); 241 GET_PROC(BindFragDataLocationIndexed);
242 } 242 }
243 243
244 interface->fExtensions.swap(&extensions); 244 interface->fExtensions.swap(&extensions);
245 return interface; 245 return interface;
246 } 246 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698