Revert of Cleanup of shader building system (patchset #25 id:470001 of https://codereview.chromium.org/611653002/)
Reason for revert:
Seems to have messed up windows 7 gms
Original issue's description:
> 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
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/635533005
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index ff37fcf..d0531a3 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -92,7 +92,7 @@
if (!fp->willUseInputColor()) {
fColorStages.reset();
}
- SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (fp));
+ SkNEW_APPEND_TO_TARRAY(&fColorStages, GrProcessorStage, (fp));
return fp;
}
@@ -104,7 +104,7 @@
if (!fp->willUseInputColor()) {
fCoverageStages.reset();
}
- SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (fp));
+ SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrProcessorStage, (fp));
return fp;
}
diff --git a/include/gpu/GrProcessorStage.h b/include/gpu/GrProcessorStage.h
index 5cc06e7..1485ca7 100644
--- a/include/gpu/GrProcessorStage.h
+++ b/include/gpu/GrProcessorStage.h
@@ -31,8 +31,6 @@
fCoordChangeMatrixSet = false;
}
- virtual ~GrProcessorStage() {}
-
GrProcessorStage(const GrProcessorStage& other) {
fCoordChangeMatrixSet = other.fCoordChangeMatrixSet;
if (other.fCoordChangeMatrixSet) {
@@ -149,11 +147,11 @@
}
}
- virtual const GrProcessor* getProcessor() const = 0;
+ const GrProcessor* getProcessor() const { return fProc.get(); }
void convertToPendingExec() { fProc.convertToPendingExec(); }
-protected:
+private:
bool fCoordChangeMatrixSet;
SkMatrix fCoordChangeMatrix;
GrProgramElementRef<const GrProcessor> fProc;
@@ -163,24 +161,18 @@
public:
GrFragmentStage(const GrFragmentProcessor* fp) : GrProcessorStage(fp) {}
- virtual const GrFragmentProcessor* getProcessor() const {
- return static_cast<const GrFragmentProcessor*>(fProc.get());
+ const GrFragmentProcessor* getFragmentProcessor() const {
+ return static_cast<const GrFragmentProcessor*>(this->getProcessor());
}
-
- typedef GrFragmentProcessor Processor;
- typedef GrGLFragmentProcessor GLProcessor;
};
class GrGeometryStage : public GrProcessorStage {
public:
GrGeometryStage(const GrGeometryProcessor* gp) : GrProcessorStage(gp) {}
- virtual const GrGeometryProcessor* getProcessor() const {
- return static_cast<const GrGeometryProcessor*>(fProc.get());
+ const GrGeometryProcessor* getGeometryProcessor() const {
+ return static_cast<const GrGeometryProcessor*>(this->getProcessor());
}
-
- typedef GrGeometryProcessor Processor;
- typedef GrGLGeometryProcessor GLProcessor;
};
#endif
diff --git a/include/gpu/GrTBackendProcessorFactory.h b/include/gpu/GrTBackendProcessorFactory.h
index 78a6332..c67f508 100644
--- a/include/gpu/GrTBackendProcessorFactory.h
+++ b/include/gpu/GrTBackendProcessorFactory.h
@@ -9,6 +9,7 @@
#define GrTBackendProcessorFactory_DEFINED
#include "GrBackendProcessorFactory.h"
+#include "gl/GrGLProgramEffects.h"
/**
* Implements GrBackendEffectFactory for a GrProcessor subclass as a singleton. This can be used by