epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * 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.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
commit-bot@chromium.org | 9add5dc | 2014-04-29 20:06:22 +0000 | [diff] [blame] | 9 | #include "gl/GrGLAssembleInterface.h" |
bsalomon@google.com | 9c1f1ac | 2012-05-07 17:09:37 +0000 | [diff] [blame] | 10 | #include "../GrGLUtil.h" |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 11 | |
bsalomon@google.com | 6f47663 | 2013-01-08 16:33:41 +0000 | [diff] [blame] | 12 | #include "osmesa_wrapper.h" |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 13 | |
commit-bot@chromium.org | 9add5dc | 2014-04-29 20:06:22 +0000 | [diff] [blame] | 14 | static GrGLFuncPtr osmesa_get(void* ctx, const char name[]) { |
| 15 | SkASSERT(NULL == ctx); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 16 | SkASSERT(OSMesaGetCurrentContext()); |
commit-bot@chromium.org | 9add5dc | 2014-04-29 20:06:22 +0000 | [diff] [blame] | 17 | return OSMesaGetProcAddress(name); |
| 18 | } |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 19 | |
| 20 | const GrGLInterface* GrGLCreateMesaInterface() { |
commit-bot@chromium.org | 7c0d72f | 2014-03-31 18:34:16 +0000 | [diff] [blame] | 21 | if (NULL == OSMesaGetCurrentContext()) { |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 22 | return NULL; |
skia.committer@gmail.com | eeaeafe | 2014-04-30 03:05:25 +0000 | [diff] [blame] | 23 | } |
bsalomon | a721c81 | 2014-08-26 11:35:23 -0700 | [diff] [blame] | 24 | return GrGLAssembleInterface(NULL, osmesa_get); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 25 | } |