aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-09-18 12:26:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-18 12:26:38 -0700
commit23e280d1f227d94f6b3dfd0b47359cca1569e1b4 (patch)
tree6091e9c78cf6ecd31ce3315dbea62191818a9531 /include/gpu
parent1c4c528c2a5693c88ceb94888c747559c6a32091 (diff)
Changes to remove program effects builder
BUG=skia: R=bsalomon@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/551253004
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrEffectStage.h18
-rw-r--r--include/gpu/GrShaderVar.h10
2 files changed, 28 insertions, 0 deletions
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 6df7f90d63..b42d309d4b 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 @@ public:
}
}
+ 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 a13cb8cf7d..cbc074df7b 100644
--- a/include/gpu/GrShaderVar.h
+++ b/include/gpu/GrShaderVar.h
@@ -55,6 +55,16 @@ public:
, 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)