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

Side by Side Diff: src/gpu/gl/GrGLShaderBuilder.cpp

Issue 325703002: second try at landing improved blur rect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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
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 "gl/GrGLShaderBuilder.h" 8 #include "gl/GrGLShaderBuilder.h"
9 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLUniformHandle.h" 10 #include "gl/GrGLUniformHandle.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 /////////////////////////////////////////////////////////////////////////// 209 ///////////////////////////////////////////////////////////////////////////
210 // write the secondary color output if necessary 210 // write the secondary color output if necessary
211 if (GrGLProgramDesc::CoverageOutputUsesSecondaryOutput(header.fCoverageOutpu t)) { 211 if (GrGLProgramDesc::CoverageOutputUsesSecondaryOutput(header.fCoverageOutpu t)) {
212 const char* secondaryOutputName = this->enableSecondaryOutput(); 212 const char* secondaryOutputName = this->enableSecondaryOutput();
213 213
214 // default coeff to ones for kCoverage_DualSrcOutput 214 // default coeff to ones for kCoverage_DualSrcOutput
215 GrGLSLExpr4 coeff(1); 215 GrGLSLExpr4 coeff(1);
216 if (GrGLProgramDesc::kSecondaryCoverageISA_CoverageOutput == header.fCov erageOutput) { 216 if (GrGLProgramDesc::kSecondaryCoverageISA_CoverageOutput == header.fCov erageOutput) {
217 // Get (1-A) into coeff 217 // Get (1-A) into coeff
218 coeff = GrGLSLExpr4::VectorCast(GrGLSLExpr1(1) - inputColor.a()); 218 coeff = GrGLSLExpr4::VectorCast(GrGLSLExpr1(1) - inputColor.a());
219 } else if (GrGLProgramDesc::kSecondaryCoverageISC_CoverageOutput == 219 } else if (GrGLProgramDesc::kSecondaryCoverageISC_CoverageOutput ==
220 header.fCoverageOutput){ 220 header.fCoverageOutput){
221 // Get (1-RGBA) into coeff 221 // Get (1-RGBA) into coeff
222 coeff = GrGLSLExpr4(1) - inputColor; 222 coeff = GrGLSLExpr4(1) - inputColor;
223 } 223 }
224 // Get coeff * coverage into modulate and then write that to the dual so urce output. 224 // Get coeff * coverage into modulate and then write that to the dual so urce output.
225 this->fsCodeAppendf("\t%s = %s;\n", secondaryOutputName, (coeff * inputC overage).c_str()); 225 this->fsCodeAppendf("\t%s = %s;\n", secondaryOutputName, (coeff * inputC overage).c_str());
226 } 226 }
227 227
228 /////////////////////////////////////////////////////////////////////////// 228 ///////////////////////////////////////////////////////////////////////////
229 // combine color and coverage as frag color 229 // combine color and coverage as frag color
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 1093
1094 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, 1094 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this,
1095 effectCnt); 1095 effectCnt);
1096 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, 1096 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder,
1097 effectStages, 1097 effectStages,
1098 effectKeys, 1098 effectKeys,
1099 effectCnt, 1099 effectCnt,
1100 inOutFSColor); 1100 inOutFSColor);
1101 return pathTexGenEffectsBuilder.finish(); 1101 return pathTexGenEffectsBuilder.finish();
1102 } 1102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698