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 GrProcessor_DEFINED | 8 #ifndef GrProcessor_DEFINED |
9 #define GrProcessor_DEFINED | 9 #define GrProcessor_DEFINED |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 */ | 146 */ |
147 void computeInvariantOutput(InvariantOutput* inout) const { | 147 void computeInvariantOutput(InvariantOutput* inout) const { |
148 this->onComputeInvariantOutput(inout); | 148 this->onComputeInvariantOutput(inout); |
149 #ifdef SK_DEBUG | 149 #ifdef SK_DEBUG |
150 inout->validate(); | 150 inout->validate(); |
151 #endif | 151 #endif |
152 } | 152 } |
153 | 153 |
154 /** This object, besides creating back-end-specific helper objects, is used
for run-time-type- | 154 /** This object, besides creating back-end-specific helper objects, is used
for run-time-type- |
155 identification. The factory should be an instance of templated class, | 155 identification. The factory should be an instance of templated class, |
156 GrTBackendEffectFactory. It is templated on the subclass of GrProcessor.
The subclass must | 156 GrTBackendProcessorFactory. It is templated on the subclass of GrProcess
or. The subclass |
157 have a nested type (or typedef) named GLProcessor which will be the subc
lass of | 157 must have a nested type (or typedef) named GLProcessor which will be the
subclass of |
158 GrGLProcessor created by the factory. | 158 GrGLProcessor created by the factory. |
159 | 159 |
160 Example: | 160 Example: |
161 class MyCustomProcessor : public GrProcessor { | 161 class MyCustomProcessor : public GrProcessor { |
162 ... | 162 ... |
163 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE
{ | 163 virtual const GrBackendProcessorFactory& getFactory() const SK_OVERR
IDE { |
164 return GrTBackendEffectFactory<MyCustomProcessor>::getInstance()
; | 164 return GrTBackendProcessorFactory<MyCustomProcessor>::getInstanc
e(); |
165 } | 165 } |
166 ... | 166 ... |
167 }; | 167 }; |
168 */ | 168 */ |
169 virtual const GrBackendProcessorFactory& getFactory() const = 0; | 169 virtual const GrBackendProcessorFactory& getFactory() const = 0; |
170 | 170 |
171 /** Human-meaningful string to identify this prcoessor; may be embedded | 171 /** Human-meaningful string to identify this prcoessor; may be embedded |
172 in generated shader code. */ | 172 in generated shader code. */ |
173 const char* name() const; | 173 const char* name() const; |
174 | 174 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 /** | 237 /** |
238 * This creates a processor outside of the memory pool. The processor's destruct
or will be called | 238 * This creates a processor outside of the memory pool. The processor's destruct
or will be called |
239 * at global destruction time. NAME will be the name of the created instance. | 239 * at global destruction time. NAME will be the name of the created instance. |
240 */ | 240 */ |
241 #define GR_CREATE_STATIC_PROCESSOR(NAME, PROC_CLASS, ARGS)
\ | 241 #define GR_CREATE_STATIC_PROCESSOR(NAME, PROC_CLASS, ARGS)
\ |
242 static SkAlignedSStorage<sizeof(PROC_CLASS)> g_##NAME##_Storage;
\ | 242 static SkAlignedSStorage<sizeof(PROC_CLASS)> g_##NAME##_Storage;
\ |
243 static PROC_CLASS* NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), PROC_CLAS
S, ARGS); \ | 243 static PROC_CLASS* NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), PROC_CLAS
S, ARGS); \ |
244 static SkAutoTDestroy<GrProcessor> NAME##_ad(NAME); | 244 static SkAutoTDestroy<GrProcessor> NAME##_ad(NAME); |
245 | 245 |
246 #endif | 246 #endif |
OLD | NEW |