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

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

Issue 2324663004: Remove unneeded GrGLSLTransformedCoordsArray type (Closed)
Patch Set: update comments Created 4 years, 3 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/GrPathProcessor.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.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 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 "glsl/GrGLSLColorSpaceXformHelper.h" 10 #include "glsl/GrGLSLColorSpaceXformHelper.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 static const GrGLSLShaderVar gCubicBlendArgs[] = { 69 static const GrGLSLShaderVar gCubicBlendArgs[] = {
70 GrGLSLShaderVar("coefficients", kMat44f_GrSLType), 70 GrGLSLShaderVar("coefficients", kMat44f_GrSLType),
71 GrGLSLShaderVar("t", kFloat_GrSLType), 71 GrGLSLShaderVar("t", kFloat_GrSLType),
72 GrGLSLShaderVar("c0", kVec4f_GrSLType), 72 GrGLSLShaderVar("c0", kVec4f_GrSLType),
73 GrGLSLShaderVar("c1", kVec4f_GrSLType), 73 GrGLSLShaderVar("c1", kVec4f_GrSLType),
74 GrGLSLShaderVar("c2", kVec4f_GrSLType), 74 GrGLSLShaderVar("c2", kVec4f_GrSLType),
75 GrGLSLShaderVar("c3", kVec4f_GrSLType), 75 GrGLSLShaderVar("c3", kVec4f_GrSLType),
76 }; 76 };
77 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; 77 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
78 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 78 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]);
79 fragBuilder->emitFunction(kVec4f_GrSLType, 79 fragBuilder->emitFunction(kVec4f_GrSLType,
80 "cubicBlend", 80 "cubicBlend",
81 SK_ARRAY_COUNT(gCubicBlendArgs), 81 SK_ARRAY_COUNT(gCubicBlendArgs),
82 gCubicBlendArgs, 82 gCubicBlendArgs,
83 "\tvec4 ts = vec4(1.0, t, t * t, t * t * t);\n" 83 "\tvec4 ts = vec4(1.0, t, t * t, t * t * t);\n"
84 "\tvec4 c = coefficients * ts;\n" 84 "\tvec4 c = coefficients * ts;\n"
85 "\treturn c.x * c0 + c.y * c1 + c.z * c2 + c.w * c 3;\n", 85 "\treturn c.x * c0 + c.y * c1 + c.z * c2 + c.w * c 3;\n",
86 &cubicBlendName); 86 &cubicBlendName);
87 fragBuilder->codeAppendf("\tvec2 coord = %s - %s * vec2(0.5);\n", coords2D.c _str(), imgInc); 87 fragBuilder->codeAppendf("\tvec2 coord = %s - %s * vec2(0.5);\n", coords2D.c _str(), imgInc);
88 // We unnormalize the coord in order to determine our fractional offset (f) within the texel 88 // We unnormalize the coord in order to determine our fractional offset (f) within the texel
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Use bilerp to handle rotation or fractional translation. 233 // Use bilerp to handle rotation or fractional translation.
234 *filterMode = GrTextureParams::kBilerp_FilterMode; 234 *filterMode = GrTextureParams::kBilerp_FilterMode;
235 } 235 }
236 return false; 236 return false;
237 } 237 }
238 // When we use the bicubic filtering effect each sample is read from the tex ture using 238 // When we use the bicubic filtering effect each sample is read from the tex ture using
239 // nearest neighbor sampling. 239 // nearest neighbor sampling.
240 *filterMode = GrTextureParams::kNone_FilterMode; 240 *filterMode = GrTextureParams::kNone_FilterMode;
241 return true; 241 return true;
242 } 242 }
OLDNEW
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698