Home | History | Annotate | Download | only in unix
      1 /*
      2  * Copyright 2014 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 
      8 
      9 #include "gl/GrGLInterface.h"
     10 #include "gl/GrGLAssembleInterface.h"
     11 
     12 #include <GL/glx.h>
     13 
     14 static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
     15     SkASSERT(NULL == ctx);
     16     SkASSERT(NULL != glXGetCurrentContext());
     17     return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
     18 }
     19 
     20 const GrGLInterface* GrGLCreateNativeInterface() {
     21     if (NULL == glXGetCurrentContext()) {
     22         return NULL;
     23     }
     24     return GrGLAssembleGLInterface(NULL, glx_get);
     25 }
     26