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

Unified Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.h

Issue 1286293002: Added class AutoFragmentChildProcAdvance to be constructed before a child emitCode and destructed a… (Closed) Base URL: https://skia.googlesource.com/skia@cs3_onBeforeAfter
Patch Set: added comment explaining AutoFragmentChildProcAdvance 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 | « include/gpu/GrFragmentProcessor.h ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
index 8746fffb8b101f75cb3d637045b2fa736bfd6bfd..514bcc6e8891a9b3ed65822c6c18e9513950467d 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
@@ -77,6 +77,37 @@ public:
return ret;
}
+ /* This class is like AutoStageAdvance but used for the child procs of a fragment proc.
+ * Before a proc calls emitCode on one of its children, it should instantiate this
+ * class inside its own scope. This which will update a state in GrGLFragmentBuilder that tracks
+ * which proc in the tree is about to emit code (it does so by calling GrGLFragmentBuilder::
+ * onBeforeChildProcEmitCode() in the constructor).
+ *
+ * After the child proc emitCode is called, the parent proc should end the scope so the
+ * AutoFragmentChildProcAdvance destructor is called, which will again update a state in
+ * GrGLFragmentShaderBuilder notifying it that the child proc's code has been emitted (it does
+ * so by calling GrGLFragmentBuilder::onAfterChildProcEmitCode()).
+ */
+ class AutoFragmentChildProcAdvance {
+ typedef GrGLProcessor::TransformedCoordsArray TransformedCoordsArray;
+ typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
+ public:
+ AutoFragmentChildProcAdvance(int childProcIndex,
+ GrGLFPBuilder* builder,
+ const GrFragmentProcessor& fp,
+ const char* outputColor,
+ const TransformedCoordsArray& coords,
+ const TextureSamplerArray& samplers,
+ const GrFragmentProcessor** childFp,
+ SkString* childOutputColor,
+ TransformedCoordsArray* childCoords,
+ TextureSamplerArray* childSamplers);
+
+ ~AutoFragmentChildProcAdvance();
+ private:
+ GrGLFragmentBuilder* fFsb;
+ };
+
private:
/*
* State that tracks which child proc in the proc tree is currently emitting code. This is
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698