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

Side by Side Diff: src/gpu/effects/GrBicubicEffect.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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "GrBicubicEffect.h" 8 #include "GrBicubicEffect.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 void GrGLBicubicEffect::emitCode(GrGLFPBuilder* builder, 54 void GrGLBicubicEffect::emitCode(GrGLFPBuilder* builder,
55 const GrFragmentProcessor& effect, 55 const GrFragmentProcessor& effect,
56 const char* outputColor, 56 const char* outputColor,
57 const char* inputColor, 57 const char* inputColor,
58 const TransformedCoordsArray& coords, 58 const TransformedCoordsArray& coords,
59 const TextureSamplerArray& samplers) { 59 const TextureSamplerArray& samplers) {
60 const GrTextureDomain& domain = effect.cast<GrBicubicEffect>().domain(); 60 const GrTextureDomain& domain = effect.cast<GrBicubicEffect>().domain();
61 61
62 fCoefficientsUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibil ity, 62 fCoefficientsUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibil ity,
63 kMat44f_GrSLType, "Coefficients"); 63 kMat44f_GrSLType, kDefault_GrSLPrecis ion,
64 "Coefficients");
64 fImageIncrementUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility, 65 fImageIncrementUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility,
65 kVec2f_GrSLType, "ImageIncrement"); 66 kVec2f_GrSLType, kDefault_GrSLPreci sion,
67 "ImageIncrement");
66 68
67 const char* imgInc = builder->getUniformCStr(fImageIncrementUni); 69 const char* imgInc = builder->getUniformCStr(fImageIncrementUni);
68 const char* coeff = builder->getUniformCStr(fCoefficientsUni); 70 const char* coeff = builder->getUniformCStr(fCoefficientsUni);
69 71
70 SkString cubicBlendName; 72 SkString cubicBlendName;
71 73
72 static const GrGLShaderVar gCubicBlendArgs[] = { 74 static const GrGLShaderVar gCubicBlendArgs[] = {
73 GrGLShaderVar("coefficients", kMat44f_GrSLType), 75 GrGLShaderVar("coefficients", kMat44f_GrSLType),
74 GrGLShaderVar("t", kFloat_GrSLType), 76 GrGLShaderVar("t", kFloat_GrSLType),
75 GrGLShaderVar("c0", kVec4f_GrSLType), 77 GrGLShaderVar("c0", kVec4f_GrSLType),
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Use bilerp to handle rotation or fractional translation. 218 // Use bilerp to handle rotation or fractional translation.
217 *filterMode = GrTextureParams::kBilerp_FilterMode; 219 *filterMode = GrTextureParams::kBilerp_FilterMode;
218 } 220 }
219 return false; 221 return false;
220 } 222 }
221 // When we use the bicubic filtering effect each sample is read from the tex ture using 223 // When we use the bicubic filtering effect each sample is read from the tex ture using
222 // nearest neighbor sampling. 224 // nearest neighbor sampling.
223 *filterMode = GrTextureParams::kNone_FilterMode; 225 *filterMode = GrTextureParams::kNone_FilterMode;
224 return true; 226 return true;
225 } 227 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698