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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 1275853005: All child GrFragmentProcs' transforms and textures will be stored in the root GrFragmentProc in pre… (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: child procs keep copy of their arrays 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index c7528f0d4d0ca680c84cdc51fecf6ecfb965ecfa..079b129cb1808d2794101c276d75d834ef8abd56 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -179,18 +179,6 @@ const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const {
return fGpu->ctxInfo();
}
-static void append_gr_fp_coord_transforms(const GrFragmentProcessor* processor,
- SkTArray<const GrCoordTransform*, true>* procCoords) {
- // add the coord transforms of this processor
- for (int i = 0; i < processor->numTransforms(); ++i) {
- procCoords->push_back(&processor->coordTransform(i));
- }
- // recursively add the coord transforms of this processor's child processors
- for (int i = 0; i < processor->numChildProcessors(); ++i) {
- append_gr_fp_coord_transforms(processor->childProcessor(i), procCoords);
- }
-}
-
bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage) {
// First we loop over all of the installed processors and collect coord transforms. These will
// be sent to the GrGLPrimitiveProcessor in its emitCode function
@@ -203,11 +191,10 @@ bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
if (!primProc.hasTransformedLocalCoords()) {
SkSTArray<2, const GrCoordTransform*, true>& procCoords = fCoordTransforms.push_back();
-
- append_gr_fp_coord_transforms(processor, &procCoords);
+ processor->gatherCoordTransforms(&procCoords);
}
- totalTextures += processor->numTexturesIncludeChildProcs();
+ totalTextures += processor->numTextures();
if (totalTextures >= maxTextureUnits) {
GrCapsDebugf(fGpu->caps(), "Program would use too many texture units\n");
return false;
@@ -298,7 +285,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
const GrFragmentProcessor& fp = *fs.processor();
ifp->fGLProc.reset(fp.createGLInstance());
- SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTexturesIncludeChildProcs());
+ SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTextures());
this->emitSamplers(fp, &samplers, ifp);
GrGLFragmentProcessor::EmitArgs args(this, fp, outColor, inColor, fOutCoords[index], samplers);
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698