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

Side by Side Diff: src/gpu/effects/GrConvolutionEffect.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/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.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 "GrConvolutionEffect.h" 8 #include "GrConvolutionEffect.h"
9 #include "gl/GrGLProcessor.h" 9 #include "gl/GrGLProcessor.h"
10 #include "gl/GrGLSL.h" 10 #include "gl/GrGLSL.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 "ImageIncrement"); 62 "ImageIncrement");
63 if (this->useBounds()) { 63 if (this->useBounds()) {
64 fBoundsUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibilit y, 64 fBoundsUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibilit y,
65 kVec2f_GrSLType, kDefault_GrSLPrecision , 65 kVec2f_GrSLType, kDefault_GrSLPrecision ,
66 "Bounds"); 66 "Bounds");
67 } 67 }
68 fKernelUni = builder->addUniformArray(GrGLProgramBuilder::kFragment_Visibili ty, 68 fKernelUni = builder->addUniformArray(GrGLProgramBuilder::kFragment_Visibili ty,
69 kFloat_GrSLType, kDefault_GrSLPrecisio n, 69 kFloat_GrSLType, kDefault_GrSLPrecisio n,
70 "Kernel", this->width()); 70 "Kernel", this->width());
71 71
72 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 72 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
73 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0); 73 SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
74 74
75 fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor); 75 fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor);
76 76
77 int width = this->width(); 77 int width = this->width();
78 const GrGLShaderVar& kernel = builder->getUniformVariable(fKernelUni); 78 const GrGLShaderVar& kernel = builder->getUniformVariable(fKernelUni);
79 const char* imgInc = builder->getUniformCStr(fImageIncrementUni); 79 const char* imgInc = builder->getUniformCStr(fImageIncrementUni);
80 80
81 fsBuilder->codeAppendf("\t\tvec2 coord = %s - %d.0 * %s;\n", coords2D.c_str( ), fRadius, imgInc); 81 fsBuilder->codeAppendf("\t\tvec2 coord = %s - %d.0 * %s;\n", coords2D.c_str( ), fRadius, imgInc);
82 82
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 237
238 bool useBounds = random->nextBool(); 238 bool useBounds = random->nextBool();
239 return GrConvolutionEffect::Create(textures[texIdx], 239 return GrConvolutionEffect::Create(textures[texIdx],
240 dir, 240 dir,
241 radius, 241 radius,
242 kernel, 242 kernel,
243 useBounds, 243 useBounds,
244 bounds); 244 bounds);
245 } 245 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698