aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProcessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLProcessor.h')
-rw-r--r--src/gpu/gl/GrGLProcessor.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gpu/gl/GrGLProcessor.h b/src/gpu/gl/GrGLProcessor.h
index 6401e2b324..ca4fa2459f 100644
--- a/src/gpu/gl/GrGLProcessor.h
+++ b/src/gpu/gl/GrGLProcessor.h
@@ -22,7 +22,7 @@
that their GrGLProcessors would emit the same GLSL code.
The GrGLProcessor subclass must also have a constructor of the form:
- ProcessorSubclass::ProcessorSubclass(const GrBackendProcessorFactory&, const GrProcessor&)
+ EffectSubclass::EffectSubclass(const GrBackendProcessorFactory&, const GrProcessor&)
These objects are created by the factory object returned by the GrProcessor::getFactory().
*/
@@ -70,6 +70,13 @@ public:
virtual ~GrGLProcessor() {}
+ /** A GrGLProcessor instance can be reused with any GrProcessor that produces the same stage
+ key; this function reads data from a GrProcessor and uploads any uniform variables required
+ by the shaders created in emitCode(). The GrProcessor parameter is guaranteed to be of the
+ same type that created this GrGLProcessor and to have an identical effect key as the one
+ that created this GrGLProcessor. */
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {}
+
const char* name() const { return fFactory.name(); }
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*) {}
@@ -93,7 +100,7 @@ public:
stages.
@param builder Interface used to emit code in the shaders.
- @param processor The processor that generated this program stage.
+ @param effect The effect that generated this program stage.
@param key The key that was computed by GenKey() from the generating GrProcessor.
@param outputColor A predefined vec4 in the FS in which the stage should place its output
color (or coverage).
@@ -101,27 +108,19 @@ public:
NULL in which case the implied input is solid white (all ones).
TODO: Better system for communicating optimization info (e.g. input
color is solid white, trans black, known to be opaque, etc.) that allows
- the processor to communicate back similar known info about its output.
+ the effect to communicate back similar known info about its output.
@param samplers Contains one entry for each GrTextureAccess of the GrProcessor. These
can be passed to the builder to emit texture reads in the generated
code.
TODO this should take a struct
*/
virtual void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor&,
+ const GrFragmentProcessor& effect,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) = 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&) {}
-
private:
typedef GrGLProcessor INHERITED;
};