diff options
author | 2014-10-07 16:43:25 -0700 | |
---|---|---|
committer | 2014-10-07 16:43:25 -0700 | |
commit | 47bb38283072dc87dc93220cd2f370ca109972ff (patch) | |
tree | 973cb20bb7c4cb4f865b4977b7b218829a7bf1ab /include | |
parent | e6efd39a33a9efa5e20c3289384c0e08ef8c9287 (diff) |
Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia. The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program. I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres. Outside of the builders folder
and GrGLPrograms, this change is basically just a rename
solo gp
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec
Review URL: https://codereview.chromium.org/611653002
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrPaint.h | 4 | ||||
-rw-r--r-- | include/gpu/GrProcessorStage.h | 20 | ||||
-rw-r--r-- | include/gpu/GrTBackendProcessorFactory.h | 1 |
3 files changed, 16 insertions, 9 deletions
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h index d0531a3024..ff37fcfee8 100644 --- a/include/gpu/GrPaint.h +++ b/include/gpu/GrPaint.h @@ -92,7 +92,7 @@ public: if (!fp->willUseInputColor()) { fColorStages.reset(); } - SkNEW_APPEND_TO_TARRAY(&fColorStages, GrProcessorStage, (fp)); + SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (fp)); return fp; } @@ -104,7 +104,7 @@ public: if (!fp->willUseInputColor()) { fCoverageStages.reset(); } - SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrProcessorStage, (fp)); + SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (fp)); return fp; } diff --git a/include/gpu/GrProcessorStage.h b/include/gpu/GrProcessorStage.h index 1485ca7cd1..5cc06e78db 100644 --- a/include/gpu/GrProcessorStage.h +++ b/include/gpu/GrProcessorStage.h @@ -31,6 +31,8 @@ public: fCoordChangeMatrixSet = false; } + virtual ~GrProcessorStage() {} + GrProcessorStage(const GrProcessorStage& other) { fCoordChangeMatrixSet = other.fCoordChangeMatrixSet; if (other.fCoordChangeMatrixSet) { @@ -147,11 +149,11 @@ public: } } - const GrProcessor* getProcessor() const { return fProc.get(); } + virtual const GrProcessor* getProcessor() const = 0; void convertToPendingExec() { fProc.convertToPendingExec(); } -private: +protected: bool fCoordChangeMatrixSet; SkMatrix fCoordChangeMatrix; GrProgramElementRef<const GrProcessor> fProc; @@ -161,18 +163,24 @@ class GrFragmentStage : public GrProcessorStage { public: GrFragmentStage(const GrFragmentProcessor* fp) : GrProcessorStage(fp) {} - const GrFragmentProcessor* getFragmentProcessor() const { - return static_cast<const GrFragmentProcessor*>(this->getProcessor()); + virtual const GrFragmentProcessor* getProcessor() const { + return static_cast<const GrFragmentProcessor*>(fProc.get()); } + + typedef GrFragmentProcessor Processor; + typedef GrGLFragmentProcessor GLProcessor; }; class GrGeometryStage : public GrProcessorStage { public: GrGeometryStage(const GrGeometryProcessor* gp) : GrProcessorStage(gp) {} - const GrGeometryProcessor* getGeometryProcessor() const { - return static_cast<const GrGeometryProcessor*>(this->getProcessor()); + virtual const GrGeometryProcessor* getProcessor() const { + return static_cast<const GrGeometryProcessor*>(fProc.get()); } + + typedef GrGeometryProcessor Processor; + typedef GrGLGeometryProcessor GLProcessor; }; #endif diff --git a/include/gpu/GrTBackendProcessorFactory.h b/include/gpu/GrTBackendProcessorFactory.h index c67f508f5d..78a6332d11 100644 --- a/include/gpu/GrTBackendProcessorFactory.h +++ b/include/gpu/GrTBackendProcessorFactory.h @@ -9,7 +9,6 @@ #define GrTBackendProcessorFactory_DEFINED #include "GrBackendProcessorFactory.h" -#include "gl/GrGLProgramEffects.h" /** * Implements GrBackendEffectFactory for a GrProcessor subclass as a singleton. This can be used by |