diff options
Diffstat (limited to 'src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp')
-rw-r--r-- | src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp new file mode 100644 index 0000000000..19eec7e8ac --- /dev/null +++ b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp @@ -0,0 +1,27 @@ +/* + * Copyright 2014 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#include "gl/GrGLInterface.h" +#include "gl/GrGLAssembleInterface.h" +#include "gl/GrGLUtil.h" + +#include <GL/glx.h> + +static GrGLFuncPtr glx_get(void* ctx, const char name[]) { + SkASSERT(NULL == ctx); + SkASSERT(glXGetCurrentContext()); + return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name)); +} + +const GrGLInterface* GrGLCreateNativeInterface() { + if (NULL == glXGetCurrentContext()) { + return NULL; + } + + return GrGLAssembleInterface(NULL, glx_get); +} |