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

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

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
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 "GrTextureDomain.h" 8 #include "GrTextureDomain.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 typedef GrGLSLFragmentProcessor INHERITED; 188 typedef GrGLSLFragmentProcessor INHERITED;
189 }; 189 };
190 190
191 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProcessor&) { 191 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProcessor&) {
192 } 192 }
193 193
194 void GrGLTextureDomainEffect::emitCode(EmitArgs& args) { 194 void GrGLTextureDomainEffect::emitCode(EmitArgs& args) {
195 const GrTextureDomainEffect& textureDomainEffect = args.fFp.cast<GrTextureDo mainEffect>(); 195 const GrTextureDomainEffect& textureDomainEffect = args.fFp.cast<GrTextureDo mainEffect>();
196 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 196 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
197 197
198 GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder() ; 198 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
199 SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0); 199 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0);
200 fGLDomain.sampleTexture(fsBuilder, domain, args.fOutputColor, coords2D, args .fSamplers[0], 200 fGLDomain.sampleTexture(fragBuilder, domain, args.fOutputColor, coords2D, ar gs.fSamplers[0],
201 args.fInputColor); 201 args.fInputColor);
202 } 202 }
203 203
204 void GrGLTextureDomainEffect::onSetData(const GrGLSLProgramDataManager& pdman, 204 void GrGLTextureDomainEffect::onSetData(const GrGLSLProgramDataManager& pdman,
205 const GrProcessor& processor) { 205 const GrProcessor& processor) {
206 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>(); 206 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>();
207 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 207 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
208 fGLDomain.setData(pdman, domain, processor.texture(0)->origin()); 208 fGLDomain.setData(pdman, domain, processor.texture(0)->origin());
209 } 209 }
210 210
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; 291 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
292 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet; 292 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet;
293 return GrTextureDomainEffect::Create( 293 return GrTextureDomainEffect::Create(
294 d->fTextures[texIdx], 294 d->fTextures[texIdx],
295 matrix, 295 matrix,
296 domain, 296 domain,
297 mode, 297 mode,
298 bilerp ? GrTextureParams::kBilerp_FilterMode : GrTextureParams::kNone_Fi lterMode, 298 bilerp ? GrTextureParams::kBilerp_FilterMode : GrTextureParams::kNone_Fi lterMode,
299 coords); 299 coords);
300 } 300 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698