blob: b914b0be9c1563d6c6581ebec3f5896baadc8036 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
bungeman@google.com0e454412011-05-19 17:47:02 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
bungeman@google.com0e454412011-05-19 17:47:02 +00007 */
8
commit-bot@chromium.org9add5dc2014-04-29 20:06:22 +00009#include "gl/GrGLAssembleInterface.h"
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +000010#include "../GrGLUtil.h"
bungeman@google.com0e454412011-05-19 17:47:02 +000011
bsalomon@google.com6f476632013-01-08 16:33:41 +000012#include "osmesa_wrapper.h"
bungeman@google.com0e454412011-05-19 17:47:02 +000013
commit-bot@chromium.org9add5dc2014-04-29 20:06:22 +000014static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) {
15 SkASSERT(NULL == ctx);
16 SkASSERT(NULL != OSMesaGetCurrentContext());
17 return OSMesaGetProcAddress(name);
18}
bsalomon@google.com373a6632011-10-19 20:43:20 +000019
20const GrGLInterface* GrGLCreateMesaInterface() {
commit-bot@chromium.org7c0d72f2014-03-31 18:34:16 +000021 if (NULL == OSMesaGetCurrentContext()) {
bsalomon@google.com6fb736f2011-09-16 18:51:57 +000022 return NULL;
skia.committer@gmail.comeeaeafe2014-04-30 03:05:25 +000023 }
bsalomona721c812014-08-26 11:35:23 -070024 return GrGLAssembleInterface(NULL, osmesa_get);
bungeman@google.com0e454412011-05-19 17:47:02 +000025}