OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLNoOpInterface.h" | 8 #include "GrGLNoOpInterface.h" |
9 #include "SkString.h" | 9 #include "SkString.h" |
10 #include "SkThread.h" | 10 #include "SkThread.h" |
11 | 11 |
12 // the OpenGLES 2.0 spec says this must be >= 128 | 12 // the OpenGLES 2.0 spec says this must be >= 128 |
13 static const GrGLint kDefaultMaxVertexUniformVectors = 128; | 13 static const GrGLint kDefaultMaxVertexUniformVectors = 128; |
14 | 14 |
15 // the OpenGLES 2.0 spec says this must be >=16 | 15 // the OpenGLES 2.0 spec says this must be >=16 |
16 static const GrGLint kDefaultMaxFragmentUniformVectors = 16; | 16 static const GrGLint kDefaultMaxFragmentUniformVectors = 16; |
17 | 17 |
18 // the OpenGLES 2.0 spec says this must be >= 8 | 18 // the OpenGLES 2.0 spec says this must be >= 8 |
19 static const GrGLint kDefaultMaxVertexAttribs = 8; | 19 static const GrGLint kDefaultMaxVertexAttribs = 8; |
20 | 20 |
21 // the OpenGLES 2.0 spec says this must be >= 8 | 21 // the OpenGLES 2.0 spec says this must be >= 8 |
22 static const GrGLint kDefaultMaxVaryingVectors = 8; | 22 static const GrGLint kDefaultMaxVaryingVectors = 8; |
23 | 23 |
24 static const char* kExtensions[] = { | 24 static const char* kExtensions[] = { |
25 "GL_ARB_framebuffer_object", | 25 "GL_ARB_framebuffer_object", |
26 "GL_ARB_blend_func_extended", | 26 "GL_ARB_blend_func_extended", |
27 "GL_ARB_timer_query", | 27 "GL_ARB_timer_query", |
28 "GL_ARB_draw_buffers", | 28 "GL_ARB_draw_buffers", |
29 "GL_ARB_occlusion_query", | 29 "GL_ARB_occlusion_query", |
| 30 "GL_EXT_blend_color", |
30 "GL_EXT_stencil_wrap" | 31 "GL_EXT_stencil_wrap" |
31 }; | 32 }; |
32 | 33 |
33 namespace { | 34 namespace { |
34 const GrGLubyte* combined_extensions_string() { | 35 const GrGLubyte* combined_extensions_string() { |
35 static SkString gExtString; | 36 static SkString gExtString; |
36 static SkMutex gMutex; | 37 static SkMutex gMutex; |
37 gMutex.acquire(); | 38 gMutex.acquire(); |
38 if (0 == gExtString.size()) { | 39 if (0 == gExtString.size()) { |
39 for (size_t i = 0; i < SK_ARRAY_COUNT(kExtensions) - 1; ++i) { | 40 for (size_t i = 0; i < SK_ARRAY_COUNT(kExtensions) - 1; ++i) { |
40 gExtString.append(kExtensions[i]); | 41 gExtString.append(kExtensions[i]); |
41 gExtString.append(" "); | 42 gExtString.append(" "); |
42 } | 43 } |
43 gExtString.append(kExtensions[SK_ARRAY_COUNT(kExtensions) - 1]); | 44 gExtString.append(kExtensions[SK_ARRAY_COUNT(kExtensions) - 1]); |
44 } | 45 } |
45 gMutex.release(); | 46 gMutex.release(); |
46 return (const GrGLubyte*) gExtString.c_str(); | 47 return (const GrGLubyte*) gExtString.c_str(); |
47 } | 48 } |
48 } | 49 } |
49 | 50 |
50 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocation(GrGLuint program, | |
51 GrGLuint colorNumber, | |
52 const GrGLchar* name) { | |
53 } | |
54 | |
55 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red, | 51 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red, |
56 GrGLclampf green, | 52 GrGLclampf green, |
57 GrGLclampf blue, | 53 GrGLclampf blue, |
58 GrGLclampf alpha) { | 54 GrGLclampf alpha) { |
59 } | 55 } |
60 | 56 |
61 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendEquation(GrGLenum mode) { | 57 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocation(GrGLuint program, |
| 58 GrGLuint colorNumber, |
| 59 const GrGLchar* name) { |
62 } | 60 } |
63 | 61 |
64 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendFunc(GrGLenum sfactor, | 62 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendFunc(GrGLenum sfactor, |
65 GrGLenum dfactor) { | 63 GrGLenum dfactor) { |
66 } | 64 } |
67 | 65 |
68 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBufferSubData(GrGLenum target, | 66 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBufferSubData(GrGLenum target, |
69 GrGLintptr offset, | 67 GrGLintptr offset, |
70 GrGLsizeiptr size, | 68 GrGLsizeiptr size, |
71 const GrGLvoid* data) { | 69 const GrGLvoid* data) { |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 static int gUniLocation = 0; | 655 static int gUniLocation = 0; |
658 return ++gUniLocation; | 656 return ++gUniLocation; |
659 } | 657 } |
660 | 658 |
661 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLInsertEventMarker(GrGLsizei length, const cha
r* marker) { | 659 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLInsertEventMarker(GrGLsizei length, const cha
r* marker) { |
662 } | 660 } |
663 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPushGroupMarker(GrGLsizei length , const cha
r* marker) { | 661 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPushGroupMarker(GrGLsizei length , const cha
r* marker) { |
664 } | 662 } |
665 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPopGroupMarker() { | 663 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPopGroupMarker() { |
666 } | 664 } |
OLD | NEW |