Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 648463003: FPs now use the correct builder types(just a rename) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrTextureDomain.h" 9 #include "GrTextureDomain.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 } 163 }
164 164
165 165
166 ////////////////////////////////////////////////////////////////////////////// 166 //////////////////////////////////////////////////////////////////////////////
167 167
168 class GrGLTextureDomainEffect : public GrGLFragmentProcessor { 168 class GrGLTextureDomainEffect : public GrGLFragmentProcessor {
169 public: 169 public:
170 GrGLTextureDomainEffect(const GrBackendProcessorFactory&, const GrProcessor& ); 170 GrGLTextureDomainEffect(const GrBackendProcessorFactory&, const GrProcessor& );
171 171
172 virtual void emitCode(GrGLProgramBuilder*, 172 virtual void emitCode(GrGLFPBuilder*,
173 const GrFragmentProcessor&, 173 const GrFragmentProcessor&,
174 const GrProcessorKey&, 174 const GrProcessorKey&,
175 const char* outputColor, 175 const char* outputColor,
176 const char* inputColor, 176 const char* inputColor,
177 const TransformedCoordsArray&, 177 const TransformedCoordsArray&,
178 const TextureSamplerArray&) SK_OVERRIDE; 178 const TextureSamplerArray&) SK_OVERRIDE;
179 179
180 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O VERRIDE; 180 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O VERRIDE;
181 181
182 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe yBuilder*); 182 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe yBuilder*);
183 183
184 private: 184 private:
185 GrTextureDomain::GLDomain fGLDomain; 185 GrTextureDomain::GLDomain fGLDomain;
186 typedef GrGLFragmentProcessor INHERITED; 186 typedef GrGLFragmentProcessor INHERITED;
187 }; 187 };
188 188
189 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendProcessorFactory & factory, 189 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendProcessorFactory & factory,
190 const GrProcessor&) 190 const GrProcessor&)
191 : INHERITED(factory) { 191 : INHERITED(factory) {
192 } 192 }
193 193
194 void GrGLTextureDomainEffect::emitCode(GrGLProgramBuilder* builder, 194 void GrGLTextureDomainEffect::emitCode(GrGLFPBuilder* builder,
195 const GrFragmentProcessor& fp, 195 const GrFragmentProcessor& fp,
196 const GrProcessorKey& key, 196 const GrProcessorKey& key,
197 const char* outputColor, 197 const char* outputColor,
198 const char* inputColor, 198 const char* inputColor,
199 const TransformedCoordsArray& coords, 199 const TransformedCoordsArray& coords,
200 const TextureSamplerArray& samplers) { 200 const TextureSamplerArray& samplers) {
201 const GrTextureDomainEffect& textureDomainEffect = fp.cast<GrTextureDomainEf fect>(); 201 const GrTextureDomainEffect& textureDomainEffect = fp.cast<GrTextureDomainEf fect>();
202 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 202 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
203 203
204 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 204 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
205 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0); 205 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
206 fGLDomain.sampleTexture(fsBuilder, domain, outputColor, coords2D, samplers[0 ], inputColor); 206 fGLDomain.sampleTexture(fsBuilder, domain, outputColor, coords2D, samplers[0 ], inputColor);
207 } 207 }
208 208
209 void GrGLTextureDomainEffect::setData(const GrGLProgramDataManager& pdman, 209 void GrGLTextureDomainEffect::setData(const GrGLProgramDataManager& pdman,
210 const GrProcessor& processor) { 210 const GrProcessor& processor) {
211 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>(); 211 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>();
212 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 212 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
213 fGLDomain.setData(pdman, domain, processor.texture(0)->origin()); 213 fGLDomain.setData(pdman, domain, processor.texture(0)->origin());
214 } 214 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); 298 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random);
299 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 299 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse;
300 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet; 300 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet;
301 return GrTextureDomainEffect::Create(textures[texIdx], 301 return GrTextureDomainEffect::Create(textures[texIdx],
302 matrix, 302 matrix,
303 domain, 303 domain,
304 mode, 304 mode,
305 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 305 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
306 coords); 306 coords);
307 } 307 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698