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

Side by Side Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp

Issue 1321253003: emitChild() takes an outputColor instead of generating one (Closed) Base URL: https://skia.googlesource.com/skia@cs3_composeshader2
Patch Set: rebase Created 5 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/gl/builders/GrGLFragmentShaderBuilder.h ('k') | no next file » | 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 "GrGLFragmentShaderBuilder.h" 8 #include "GrGLFragmentShaderBuilder.h"
9 #include "GrGLProgramBuilder.h" 9 #include "GrGLProgramBuilder.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 void GrGLFragmentShaderBuilder::addVarying(GrGLVarying* v, GrSLPrecision fsPrec) { 296 void GrGLFragmentShaderBuilder::addVarying(GrGLVarying* v, GrSLPrecision fsPrec) {
297 v->fFsIn = v->fVsOut; 297 v->fFsIn = v->fVsOut;
298 if (v->fGsOut) { 298 if (v->fGsOut) {
299 v->fFsIn = v->fGsOut; 299 v->fFsIn = v->fGsOut;
300 } 300 }
301 fInputs.push_back().set(v->fType, GrGLShaderVar::kVaryingIn_TypeModifier, v- >fFsIn, fsPrec); 301 fInputs.push_back().set(v->fType, GrGLShaderVar::kVaryingIn_TypeModifier, v- >fFsIn, fsPrec);
302 } 302 }
303 303
304 void GrGLFragmentBuilder::onBeforeChildProcEmitCode() { 304 void GrGLFragmentBuilder::onBeforeChildProcEmitCode() {
305 fSubstageIndices.back()++; 305 SkASSERT(fSubstageIndices.count() >= 1);
306 fSubstageIndices.push_back(0); 306 fSubstageIndices.push_back(0);
307 fMangleString.append(this->getMangleStringThisLevel()); 307 // second-to-last value in the fSubstageIndices stack is the index of the ch ild proc
308 // at that level which is currently emitting code.
309 fMangleString.appendf("_c%d", fSubstageIndices[fSubstageIndices.count() - 2] );
308 } 310 }
309 311
310 void GrGLFragmentBuilder::onAfterChildProcEmitCode() { 312 void GrGLFragmentBuilder::onAfterChildProcEmitCode() {
313 SkASSERT(fSubstageIndices.count() >= 2);
311 fSubstageIndices.pop_back(); 314 fSubstageIndices.pop_back();
315 fSubstageIndices.back()++;
312 int removeAt = fMangleString.findLastOf('_'); 316 int removeAt = fMangleString.findLastOf('_');
313 fMangleString.remove(removeAt, fMangleString.size() - removeAt); 317 fMangleString.remove(removeAt, fMangleString.size() - removeAt);
314 } 318 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698