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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 "GrTextureDomain.h" 8 #include "GrTextureDomain.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 void GrGLTextureDomainEffect::emitCode(GrGLFPBuilder* builder, 191 void GrGLTextureDomainEffect::emitCode(GrGLFPBuilder* builder,
192 const GrFragmentProcessor& fp, 192 const GrFragmentProcessor& fp,
193 const char* outputColor, 193 const char* outputColor,
194 const char* inputColor, 194 const char* inputColor,
195 const TransformedCoordsArray& coords, 195 const TransformedCoordsArray& coords,
196 const TextureSamplerArray& samplers) { 196 const TextureSamplerArray& samplers) {
197 const GrTextureDomainEffect& textureDomainEffect = fp.cast<GrTextureDomainEf fect>(); 197 const GrTextureDomainEffect& textureDomainEffect = fp.cast<GrTextureDomainEf fect>();
198 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 198 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
199 199
200 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 200 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
201 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0); 201 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
202 fGLDomain.sampleTexture(fsBuilder, domain, outputColor, coords2D, samplers[0 ], inputColor); 202 fGLDomain.sampleTexture(fsBuilder, domain, outputColor, coords2D, samplers[0 ], inputColor);
203 } 203 }
204 204
205 void GrGLTextureDomainEffect::setData(const GrGLProgramDataManager& pdman, 205 void GrGLTextureDomainEffect::setData(const GrGLProgramDataManager& pdman,
206 const GrProcessor& processor) { 206 const GrProcessor& processor) {
207 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>(); 207 const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureD omainEffect>();
208 const GrTextureDomain& domain = textureDomainEffect.textureDomain(); 208 const GrTextureDomain& domain = textureDomainEffect.textureDomain();
209 fGLDomain.setData(pdman, domain, processor.texture(0)->origin()); 209 fGLDomain.setData(pdman, domain, processor.texture(0)->origin());
210 } 210 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 const SkMatrix& matrix = GrTest::TestMatrix(random); 302 const SkMatrix& matrix = GrTest::TestMatrix(random);
303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse;
304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoord Set; 304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoord Set;
305 return GrTextureDomainEffect::Create(textures[texIdx], 305 return GrTextureDomainEffect::Create(textures[texIdx],
306 matrix, 306 matrix,
307 domain, 307 domain,
308 mode, 308 mode,
309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
310 coords); 310 coords);
311 } 311 }
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