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

Unified Diff: src/gpu/gl/GrGLFragmentProcessor.h

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses 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/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLFragmentProcessor.h
diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h
index e130dba1e405e71c5cbdb037e4c53c3a732cee6e..c7964dcc904836df52e6b99f45c36dd260e7c2fc 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.h
+++ b/src/gpu/gl/GrGLFragmentProcessor.h
@@ -18,7 +18,11 @@ class GrGLFragmentProcessor {
public:
GrGLFragmentProcessor() {}
- virtual ~GrGLFragmentProcessor() {}
+ virtual ~GrGLFragmentProcessor() {
+ for (int i = 0; i < fChildProcessors.count(); ++i) {
+ SkDELETE(fChildProcessors[i]);
+ }
+ }
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
typedef GrGLProcessor::TransformedCoordsArray TransformedCoordsArray;
@@ -66,17 +70,29 @@ public:
virtual void emitCode(EmitArgs&) = 0;
- /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
- the same stage key; this function reads data from a GrFragmentProcessor and uploads any
- uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor
- parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and
- to have an identical processor key as the one that created this GrGLFragmentProcessor. */
- // TODO update this to pass in GrFragmentProcessor
- virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {}
+ void setData(const GrGLProgramDataManager& pdman, const GrFragmentProcessor& processor);
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
+ int numChildProcessors() const { return fChildProcessors.count(); }
+
+ GrGLFragmentProcessor* childProcessor(int index) const {
+ return fChildProcessors[index];
+ }
+
+protected:
+ /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
+ the same stage key; this function reads data from a GrFragmentProcessor and uploads any
+ uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor
+ parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and
+ to have an identical processor key as the one that created this GrGLFragmentProcessor. */
+ // TODO update this to pass in GrFragmentProcessor
+ virtual void onSetData(const GrGLProgramDataManager&, const GrProcessor&) {}
+
private:
+ SkTArray<GrGLFragmentProcessor*, true> fChildProcessors;
+
+ friend class GrFragmentProcessor;
typedef GrGLProcessor INHERITED;
};
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698