OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrGLVertexShader_DEFINED | 8 #ifndef GrGLVertexShader_DEFINED |
9 #define GrGLVertexShader_DEFINED | 9 #define GrGLVertexShader_DEFINED |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 /* | 35 /* |
36 * Internal call for GrGLProgramBuilder.addVarying | 36 * Internal call for GrGLProgramBuilder.addVarying |
37 */ | 37 */ |
38 void addVarying(const char* name, GrGLVarying*); | 38 void addVarying(const char* name, GrGLVarying*); |
39 | 39 |
40 /* | 40 /* |
41 * private helpers for compilation by GrGLProgramBuilder | 41 * private helpers for compilation by GrGLProgramBuilder |
42 */ | 42 */ |
43 void setupLocalCoords(); | 43 void setupLocalCoords(); |
44 void transformGLToSkiaCoords(); | 44 void transformGLToSkiaCoords(); |
| 45 void setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr1* out); |
45 void setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out); | 46 void setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out); |
46 void emitAttributes(const GrGeometryProcessor& gp); | 47 void emitAttributes(const GrGeometryProcessor& gp); |
47 void transformSkiaToGLCoords(); | 48 void transformSkiaToGLCoords(); |
48 void bindVertexAttributes(GrGLuint programID); | 49 void bindVertexAttributes(GrGLuint programID); |
49 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; | 50 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; |
50 | 51 |
51 // an internal call which checks for uniquness of a var before adding it to
the list of inputs | 52 // an internal call which checks for uniquness of a var before adding it to
the list of inputs |
52 bool addAttribute(const GrShaderVar& var); | 53 bool addAttribute(const GrShaderVar& var); |
53 struct AttributePair { | 54 struct AttributePair { |
54 void set(int index, const SkString& name) { | 55 void set(int index, const SkString& name) { |
55 fIndex = index; fName = name; | 56 fIndex = index; fName = name; |
56 } | 57 } |
57 int fIndex; | 58 int fIndex; |
58 SkString fName; | 59 SkString fName; |
59 }; | 60 }; |
60 | 61 |
61 GrGLShaderVar* fPositionVar; | 62 GrGLShaderVar* fPositionVar; |
62 GrGLShaderVar* fLocalCoordsVar; | 63 GrGLShaderVar* fLocalCoordsVar; |
63 int fEffectAttribOffset; | 64 int fEffectAttribOffset; |
64 | 65 |
65 friend class GrGLProgramBuilder; | 66 friend class GrGLProgramBuilder; |
66 | 67 |
67 typedef GrGLShaderBuilder INHERITED; | 68 typedef GrGLShaderBuilder INHERITED; |
68 }; | 69 }; |
69 | 70 |
70 #endif | 71 #endif |
OLD | NEW |