Changes to remove program effects builder
BUG=skia:
R=bsalomon@google.com
Author: joshualitt@chromium.org
Review URL: https://codereview.chromium.org/551253004
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 6df7f90..b42d309 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -12,6 +12,7 @@
#define GrEffectStage_DEFINED
#include "GrBackendEffectFactory.h"
+#include "GrCoordTransform.h"
#include "GrEffect.h"
#include "GrProgramElementRef.h"
#include "SkMatrix.h"
@@ -128,6 +129,23 @@
}
}
+ bool isPerspectiveCoordTransform(int matrixIndex, bool useExplicitLocalCoords) const {
+ const GrCoordTransform& coordTransform = this->getEffect()->coordTransform(matrixIndex);
+ SkMatrix::TypeMask type0 = coordTransform.getMatrix().getType();
+ SkMatrix::TypeMask type1 = SkMatrix::kIdentity_Mask;
+ if (kLocal_GrCoordSet == coordTransform.sourceCoords()) {
+ type1 = useExplicitLocalCoords ?
+ SkMatrix::kIdentity_Mask : this->getCoordChangeMatrix().getType();
+ }
+
+ int combinedTypes = type0 | type1;
+ if (SkMatrix::kPerspective_Mask & combinedTypes) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
const GrEffect* getEffect() const { return fEffect.get(); }
void convertToPendingExec() { fEffect.convertToPendingExec(); }
diff --git a/include/gpu/GrShaderVar.h b/include/gpu/GrShaderVar.h
index a13cb8c..cbc074d 100644
--- a/include/gpu/GrShaderVar.h
+++ b/include/gpu/GrShaderVar.h
@@ -55,6 +55,16 @@
, fPrecision(kDefault_Precision) {
}
+ GrShaderVar(const SkString& name, GrSLType type, int arrayCount = kNonArray,
+ Precision precision = kDefault_Precision)
+ : fType(type)
+ , fTypeModifier(kNone_TypeModifier)
+ , fName(name)
+ , fCount(arrayCount)
+ , fPrecision(precision) {
+ SkASSERT(kVoid_GrSLType != type);
+ }
+
GrShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray,
Precision precision = kDefault_Precision)
: fType(type)