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

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

Issue 788733003: Make addUniform take a precision (Closed) Base URL: https://skia.googlesource.com/skia.git@move_prec
Patch Set: rebase Created 6 years 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/GrRRectEffect.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 SkDEBUGCODE(fMode = textureDomain.mode();) 49 SkDEBUGCODE(fMode = textureDomain.mode();)
50 50
51 GrGLProgramBuilder* program = builder->getProgramBuilder(); 51 GrGLProgramBuilder* program = builder->getProgramBuilder();
52 52
53 if (textureDomain.mode() != kIgnore_Mode && !fDomainUni.isValid()) { 53 if (textureDomain.mode() != kIgnore_Mode && !fDomainUni.isValid()) {
54 const char* name; 54 const char* name;
55 SkString uniName("TexDom"); 55 SkString uniName("TexDom");
56 if (textureDomain.fIndex >= 0) { 56 if (textureDomain.fIndex >= 0) {
57 uniName.appendS32(textureDomain.fIndex); 57 uniName.appendS32(textureDomain.fIndex);
58 } 58 }
59 fDomainUni = program->addUniform(GrGLProgramBuilder::kFragment_Visibilit y, kVec4f_GrSLType, 59 fDomainUni = program->addUniform(GrGLProgramBuilder::kFragment_Visibilit y,
60 uniName.c_str(), &name); 60 kVec4f_GrSLType, kDefault_GrSLPrecision ,
61 uniName.c_str(), &name);
61 fDomainName = name; 62 fDomainName = name;
62 } 63 }
63 64
64 switch (textureDomain.mode()) { 65 switch (textureDomain.mode()) {
65 case kIgnore_Mode: { 66 case kIgnore_Mode: {
66 builder->codeAppendf("\t%s = ", outColor); 67 builder->codeAppendf("\t%s = ", outColor);
67 builder->appendTextureLookupAndModulate(inModulateColor, sampler, 68 builder->appendTextureLookupAndModulate(inModulateColor, sampler,
68 inCoords.c_str()); 69 inCoords.c_str());
69 builder->codeAppend(";\n"); 70 builder->codeAppend(";\n");
70 break; 71 break;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); 302 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random);
302 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse;
303 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet; 304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet;
304 return GrTextureDomainEffect::Create(textures[texIdx], 305 return GrTextureDomainEffect::Create(textures[texIdx],
305 matrix, 306 matrix,
306 domain, 307 domain,
307 mode, 308 mode,
308 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
309 coords); 310 coords);
310 } 311 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrRRectEffect.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698