| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrGLProcessor_DEFINED | 8 #ifndef GrGLProcessor_DEFINED |
| 9 #define GrGLProcessor_DEFINED | 9 #define GrGLProcessor_DEFINED |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 uint32_t fConfigComponentMask; | 63 uint32_t fConfigComponentMask; |
| 64 char fSwizzle[5]; | 64 char fSwizzle[5]; |
| 65 | 65 |
| 66 friend class GrGLShaderBuilder; | 66 friend class GrGLShaderBuilder; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 typedef SkTArray<TextureSampler> TextureSamplerArray; | 69 typedef SkTArray<TextureSampler> TextureSamplerArray; |
| 70 | 70 |
| 71 virtual ~GrGLProcessor() {} | 71 virtual ~GrGLProcessor() {} |
| 72 | 72 |
| 73 /** A GrGLProcessor instance can be reused with any GrProcessor that produce
s the same stage | |
| 74 key; this function reads data from a GrProcessor and uploads any uniform
variables required | |
| 75 by the shaders created in emitCode(). The GrProcessor parameter is guara
nteed to be of the | |
| 76 same type that created this GrGLProcessor and to have an identical effec
t key as the one | |
| 77 that created this GrGLProcessor. */ | |
| 78 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {} | |
| 79 | |
| 80 const char* name() const { return fFactory.name(); } | 73 const char* name() const { return fFactory.name(); } |
| 81 | 74 |
| 82 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde
r*) {} | 75 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde
r*) {} |
| 83 | 76 |
| 84 protected: | 77 protected: |
| 85 const GrBackendProcessorFactory& fFactory; | 78 const GrBackendProcessorFactory& fFactory; |
| 86 }; | 79 }; |
| 87 | 80 |
| 88 class GrGLFPBuilder; | 81 class GrGLFPBuilder; |
| 89 | 82 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 114 code. | 107 code. |
| 115 TODO this should take a struct | 108 TODO this should take a struct |
| 116 */ | 109 */ |
| 117 virtual void emitCode(GrGLFPBuilder* builder, | 110 virtual void emitCode(GrGLFPBuilder* builder, |
| 118 const GrFragmentProcessor& effect, | 111 const GrFragmentProcessor& effect, |
| 119 const char* outputColor, | 112 const char* outputColor, |
| 120 const char* inputColor, | 113 const char* inputColor, |
| 121 const TransformedCoordsArray& coords, | 114 const TransformedCoordsArray& coords, |
| 122 const TextureSamplerArray& samplers) = 0; | 115 const TextureSamplerArray& samplers) = 0; |
| 123 | 116 |
| 117 /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProces
sor that produces |
| 118 the same stage key; this function reads data from a GrFragmentProcessor
and uploads any |
| 119 uniform variables required by the shaders created in emitCode(). The GrF
ragmentProcessor |
| 120 parameter is guaranteed to be of the same type that created this GrGLFra
gmentProcessor and |
| 121 to have an identical effect key as the one that created this GrGLFragmen
tProcessor. */ |
| 122 // TODO update this to pass in GrFragmentProcessor |
| 123 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {} |
| 124 |
| 124 private: | 125 private: |
| 125 typedef GrGLProcessor INHERITED; | 126 typedef GrGLProcessor INHERITED; |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 #endif | 129 #endif |
| OLD | NEW |