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 #ifndef GrGLSLFragmentProcessor_DEFINED | 8 #ifndef GrGLSLFragmentProcessor_DEFINED |
9 #define GrGLSLFragmentProcessor_DEFINED | 9 #define GrGLSLFragmentProcessor_DEFINED |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 struct EmitArgs { | 55 struct EmitArgs { |
56 EmitArgs(GrGLSLFPFragmentBuilder* fragBuilder, | 56 EmitArgs(GrGLSLFPFragmentBuilder* fragBuilder, |
57 GrGLSLUniformHandler* uniformHandler, | 57 GrGLSLUniformHandler* uniformHandler, |
58 const GrGLSLCaps* caps, | 58 const GrGLSLCaps* caps, |
59 const GrFragmentProcessor& fp, | 59 const GrFragmentProcessor& fp, |
60 const char* outputColor, | 60 const char* outputColor, |
61 const char* inputColor, | 61 const char* inputColor, |
62 const GrGLSLTransformedCoordsArray& coords, | 62 const GrGLSLTransformedCoordsArray& coords, |
63 const SamplerHandle* texSamplers, | 63 const SamplerHandle* texSamplers, |
64 const SamplerHandle* bufferSamplers) | 64 const SamplerHandle* bufferSamplers, |
| 65 bool gpImplementsDistanceVector) |
65 : fFragBuilder(fragBuilder) | 66 : fFragBuilder(fragBuilder) |
66 , fUniformHandler(uniformHandler) | 67 , fUniformHandler(uniformHandler) |
67 , fGLSLCaps(caps) | 68 , fGLSLCaps(caps) |
68 , fFp(fp) | 69 , fFp(fp) |
69 , fOutputColor(outputColor) | 70 , fOutputColor(outputColor) |
70 , fInputColor(inputColor) | 71 , fInputColor(inputColor) |
71 , fCoords(coords) | 72 , fCoords(coords) |
72 , fTexSamplers(texSamplers) | 73 , fTexSamplers(texSamplers) |
73 , fBufferSamplers(bufferSamplers) {} | 74 , fBufferSamplers(bufferSamplers) |
| 75 , fGpImplementsDistanceVector(gpImplementsDistanceVector){} |
74 GrGLSLFPFragmentBuilder* fFragBuilder; | 76 GrGLSLFPFragmentBuilder* fFragBuilder; |
75 GrGLSLUniformHandler* fUniformHandler; | 77 GrGLSLUniformHandler* fUniformHandler; |
76 const GrGLSLCaps* fGLSLCaps; | 78 const GrGLSLCaps* fGLSLCaps; |
77 const GrFragmentProcessor& fFp; | 79 const GrFragmentProcessor& fFp; |
78 const char* fOutputColor; | 80 const char* fOutputColor; |
79 const char* fInputColor; | 81 const char* fInputColor; |
80 const GrGLSLTransformedCoordsArray& fCoords; | 82 const GrGLSLTransformedCoordsArray& fCoords; |
81 const SamplerHandle* fTexSamplers; | 83 const SamplerHandle* fTexSamplers; |
82 const SamplerHandle* fBufferSamplers; | 84 const SamplerHandle* fBufferSamplers; |
| 85 bool fGpImplementsDistanceVector; |
83 }; | 86 }; |
84 | 87 |
85 virtual void emitCode(EmitArgs&) = 0; | 88 virtual void emitCode(EmitArgs&) = 0; |
86 | 89 |
87 void setData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcesso
r& processor); | 90 void setData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcesso
r& processor); |
88 | 91 |
89 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} | 92 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} |
90 | 93 |
91 int numChildProcessors() const { return fChildProcessors.count(); } | 94 int numChildProcessors() const { return fChildProcessors.count(); } |
92 | 95 |
(...skipping 26 matching lines...) Expand all Loading... |
119 | 122 |
120 private: | 123 private: |
121 void internalEmitChild(int, const char*, const char*, EmitArgs&); | 124 void internalEmitChild(int, const char*, const char*, EmitArgs&); |
122 | 125 |
123 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors; | 126 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors; |
124 | 127 |
125 friend class GrFragmentProcessor; | 128 friend class GrFragmentProcessor; |
126 }; | 129 }; |
127 | 130 |
128 #endif | 131 #endif |
OLD | NEW |