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

Side by Side Diff: src/effects/SkColorCubeFilter.cpp

Issue 1862373003: Rename EmitArgs::fSamplers to fTexSamplers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload3_infer
Patch Set: rebase Created 4 years, 8 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/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.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 "SkColorCubeFilter.h" 8 #include "SkColorCubeFilter.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkOnce.h" 10 #include "SkOnce.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 unPMColor, colorCubeSizeUni); 270 unPMColor, colorCubeSizeUni);
271 271
272 // Compute y coord for for texture fetches. 272 // Compute y coord for for texture fetches.
273 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (floor(%s.b) + %s.g) * %s);\n ", 273 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (floor(%s.b) + %s.g) * %s);\n ",
274 cCoords1, cubeIdx, cubeIdx, cubeIdx, colorCubeInvSi zeUni); 274 cCoords1, cubeIdx, cubeIdx, cubeIdx, colorCubeInvSi zeUni);
275 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (ceil(%s.b) + %s.g) * %s);\n" , 275 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (ceil(%s.b) + %s.g) * %s);\n" ,
276 cCoords2, cubeIdx, cubeIdx, cubeIdx, colorCubeInvSi zeUni); 276 cCoords2, cubeIdx, cubeIdx, cubeIdx, colorCubeInvSi zeUni);
277 277
278 // Apply the cube. 278 // Apply the cube.
279 fragBuilder->codeAppendf("%s = vec4(mix(", args.fOutputColor); 279 fragBuilder->codeAppendf("%s = vec4(mix(", args.fOutputColor);
280 fragBuilder->appendTextureLookup(args.fSamplers[0], cCoords1); 280 fragBuilder->appendTextureLookup(args.fTexSamplers[0], cCoords1);
281 fragBuilder->codeAppend(".bgr, "); 281 fragBuilder->codeAppend(".bgr, ");
282 fragBuilder->appendTextureLookup(args.fSamplers[0], cCoords2); 282 fragBuilder->appendTextureLookup(args.fTexSamplers[0], cCoords2);
283 283
284 // Premultiply color by alpha. Note that the input alpha is not modified by this shader. 284 // Premultiply color by alpha. Note that the input alpha is not modified by this shader.
285 fragBuilder->codeAppendf(".bgr, fract(%s.b)) * vec3(%s), %s.a);\n", 285 fragBuilder->codeAppendf(".bgr, fract(%s.b)) * vec3(%s), %s.a);\n",
286 cubeIdx, nonZeroAlpha, args.fInputColor); 286 cubeIdx, nonZeroAlpha, args.fInputColor);
287 } 287 }
288 288
289 void GrColorCubeEffect::GLSLProcessor::onSetData(const GrGLSLProgramDataManager& pdman, 289 void GrColorCubeEffect::GLSLProcessor::onSetData(const GrGLSLProgramDataManager& pdman,
290 const GrProcessor& proc) { 290 const GrProcessor& proc) {
291 const GrColorCubeEffect& colorCube = proc.cast<GrColorCubeEffect>(); 291 const GrColorCubeEffect& colorCube = proc.cast<GrColorCubeEffect>();
292 SkScalar size = SkIntToScalar(colorCube.colorCubeSize()); 292 SkScalar size = SkIntToScalar(colorCube.colorCubeSize());
(...skipping 27 matching lines...) Expand all
320 if (textureCube) { 320 if (textureCube) {
321 context->textureProvider()->assignUniqueKeyToTexture(key, textureCub e); 321 context->textureProvider()->assignUniqueKeyToTexture(key, textureCub e);
322 } else { 322 } else {
323 return nullptr; 323 return nullptr;
324 } 324 }
325 } 325 }
326 326
327 return GrColorCubeEffect::Create(textureCube); 327 return GrColorCubeEffect::Create(textureCube);
328 } 328 }
329 #endif 329 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698