3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #include "gl/GrGLInterface.h"
11 #include "gl/GrGLAssembleInterface.h"
19 "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib",
24 if (NULL != fLibrary) {
29 void* handle() const {
30 return NULL == fLibrary ? RTLD_DEFAULT : fLibrary;
41 GrGLFuncPtr getProc(const char name[]) const {
42 return (GrGLFuncPtr) dlsym(fLoader.handle(), name);
49 static GrGLFuncPtr mac_get_gl_proc(void* ctx, const char name[]) {
50 SkASSERT(NULL != ctx);
51 const GLProcGetter* getter = (const GLProcGetter*) ctx;
52 return getter->getProc(name);
55 const GrGLInterface* GrGLCreateNativeInterface() {
57 return GrGLAssembleGLInterface(&getter, mac_get_gl_proc);