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

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

Issue 1243583002: Add support for transformedLocalCoords to GrDefaultGeoProc (Closed) Base URL: https://skia.googlesource.com/skia.git@pipelinetobatch2
Patch Set: tweaks Created 5 years, 4 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/GrGLGeometryProcessor.cpp ('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 "GrGLProgramBuilder.h" 8 #include "GrGLProgramBuilder.h"
9 9
10 #include "gl/GrGLGeometryProcessor.h" 10 #include "gl/GrGLGeometryProcessor.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 append_gr_fp_coord_transforms(processor->childProcessor(i), procCoords); 190 append_gr_fp_coord_transforms(processor->childProcessor(i), procCoords);
191 } 191 }
192 } 192 }
193 193
194 bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr 4* inputCoverage) { 194 bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr 4* inputCoverage) {
195 // First we loop over all of the installed processors and collect coord tran sforms. These will 195 // First we loop over all of the installed processors and collect coord tran sforms. These will
196 // be sent to the GrGLPrimitiveProcessor in its emitCode function 196 // be sent to the GrGLPrimitiveProcessor in its emitCode function
197 const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); 197 const GrPrimitiveProcessor& primProc = this->primitiveProcessor();
198 int totalTextures = primProc.numTextures(); 198 int totalTextures = primProc.numTextures();
199 const int maxTextureUnits = fGpu->glCaps().maxFragmentTextureUnits(); 199 const int maxTextureUnits = fGpu->glCaps().maxFragmentTextureUnits();
200 SkSTArray<8, GrGLProcessor::TransformedCoordsArray> outCoords; 200
201 for (int i = 0; i < this->pipeline().numFragmentStages(); i++) { 201 for (int i = 0; i < this->pipeline().numFragmentStages(); i++) {
202 const GrFragmentProcessor* processor = this->pipeline().getFragmentStage (i).processor(); 202 const GrFragmentProcessor* processor = this->pipeline().getFragmentStage (i).processor();
203 SkSTArray<2, const GrCoordTransform*, true>& procCoords = fCoordTransfor ms.push_back();
204 203
205 append_gr_fp_coord_transforms(processor, &procCoords); 204 if (!primProc.hasTransformedLocalCoords()) {
205 SkSTArray<2, const GrCoordTransform*, true>& procCoords = fCoordTran sforms.push_back();
206
207 append_gr_fp_coord_transforms(processor, &procCoords);
208 }
206 209
207 totalTextures += processor->numTexturesIncludeChildProcs(); 210 totalTextures += processor->numTexturesIncludeChildProcs();
208 if (totalTextures >= maxTextureUnits) { 211 if (totalTextures >= maxTextureUnits) {
209 GrCapsDebugf(fGpu->caps(), "Program would use too many texture units \n"); 212 GrCapsDebugf(fGpu->caps(), "Program would use too many texture units \n");
210 return false; 213 return false;
211 } 214 }
212 } 215 }
213 216
214 this->emitAndInstallProc(primProc, inputColor, inputCoverage); 217 this->emitAndInstallProc(primProc, inputColor, inputCoverage);
215 218
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 511 }
509 512
510 //////////////////////////////////////////////////////////////////////////////// /////////////////// 513 //////////////////////////////////////////////////////////////////////////////// ///////////////////
511 514
512 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 515 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
513 int numProcs = fProcs.count(); 516 int numProcs = fProcs.count();
514 for (int e = 0; e < numProcs; ++e) { 517 for (int e = 0; e < numProcs; ++e) {
515 SkDELETE(fProcs[e]); 518 SkDELETE(fProcs[e]);
516 } 519 }
517 } 520 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698