Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp

Issue 12389055: Fix mesa issues. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/gl/mesa/SkMesaGLContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "gl/GrGLExtensions.h" 9 #include "gl/GrGLExtensions.h"
10 #include "gl/GrGLInterface.h" 10 #include "gl/GrGLInterface.h"
11 #include "../GrGLUtil.h" 11 #include "../GrGLUtil.h"
12 12
13 #define GL_GLEXT_PROTOTYPES 13 #define GL_GLEXT_PROTOTYPES
14 #include "osmesa_wrapper.h" 14 #include "osmesa_wrapper.h"
15 15
16 #define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \ 16 #define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \
17 OSMesaGetProcAddress("gl" #F); 17 OSMesaGetProcAddress("gl" #F);
18 #define GR_GL_GET_PROC_SUFFIX(F, S) interface->f ## F = (GrGL ## F ## Proc) \ 18 #define GR_GL_GET_PROC_SUFFIX(F, S) interface->f ## F = (GrGL ## F ## Proc) \
19 OSMesaGetProcAddress("gl" #F #S); 19 OSMesaGetProcAddress("gl" #F #S);
20 20
21 // We use OSMesaGetProcAddress for every gl function to avoid accidentally using 21 // We use OSMesaGetProcAddress for every gl function to avoid accidentally using
22 // non-Mesa gl functions. 22 // non-Mesa gl functions.
23 23
24 const GrGLInterface* GrGLCreateMesaInterface() { 24 const GrGLInterface* GrGLCreateMesaInterface() {
25 if (NULL != OSMesaGetCurrentContext()) { 25 if (NULL != OSMesaGetCurrentContext()) {
26 26
27 GrGLGetStringProc getString = 27 GrGLGetStringProc getString = (GrGLGetStringProc) OSMesaGetProcAddress(" glGetString");
28 (GrGLGetStringProc) OSMesaGetProcAddress("glGetString"); 28 GrGLGetStringiProc getStringi = (GrGLGetStringiProc) OSMesaGetProcAddres s("glGetStringi");
29 GrGLGetStringiProc glGetStringi = 29 GrGLGetIntegervProc getIntegerv =
30 (GrGLGetStringiProc) OSMesaGetProcAddress("glGetStringi"); 30 (GrGLGetIntegervProc) OSMesaGetProcAddress("glGetIntegerv");
31 GrGLGetIntegervProc glGetIntegerv =
32 (GrGLGetIntegervProc) OSMesaGetProcAddress("glGetIntegerv");
33 31
34 GrGLExtensions extensions; 32 GrGLExtensions extensions;
35 if (!extensions.init(kDesktop_GrGLBinding, glGetString, glGetStringi, gl GetIntegerv)) { 33 if (!extensions.init(kDesktop_GrGLBinding, getString, getStringi, getInt egerv)) {
36 return NULL; 34 return NULL;
37 } 35 }
38 36
39 const char* versionString = (const char*) getString(GL_VERSION); 37 const char* versionString = (const char*) getString(GL_VERSION);
40 GrGLVersion glVer = GrGLGetVersionFromString(versionString); 38 GrGLVersion glVer = GrGLGetVersionFromString(versionString);
41 39
42 if (glVer < GR_GL_VER(1,5)) { 40 if (glVer < GR_GL_VER(1,5)) {
43 // We must have array and element_array buffer objects. 41 // We must have array and element_array buffer objects.
44 return NULL; 42 return NULL;
45 } 43 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 delete interface; 207 delete interface;
210 return NULL; 208 return NULL;
211 } 209 }
212 GR_GL_GET_PROC(BindFragDataLocationIndexed); 210 GR_GL_GET_PROC(BindFragDataLocationIndexed);
213 interface->fBindingsExported = kDesktop_GrGLBinding; 211 interface->fBindingsExported = kDesktop_GrGLBinding;
214 return interface; 212 return interface;
215 } else { 213 } else {
216 return NULL; 214 return NULL;
217 } 215 }
218 } 216 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/mesa/SkMesaGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698