aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDefaultGeoProcFactory.cpp3
-rw-r--r--src/gpu/GrGeometryProcessor.h29
-rw-r--r--src/gpu/GrPathProcessor.h2
-rw-r--r--src/gpu/GrPrimitiveProcessor.cpp18
-rw-r--r--src/gpu/GrPrimitiveProcessor.h1
5 files changed, 2 insertions, 51 deletions
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index 1448aec660..dced58a67d 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -139,7 +139,7 @@ public:
gp.viewMatrix(),
&fViewMatrixUniform);
- if (gp.hasExplicitLocalCoords()) {
+ if (gp.inLocalCoords()) {
// emit transforms with explicit local coords
this->emitTransforms(vertBuilder,
varyingHandler,
@@ -260,7 +260,6 @@ private:
}
if (fFlags & kLocalCoordAttribute_GPFlag) {
fInLocalCoords = &this->addVertexAttrib("inLocalCoord", kFloat2_GrVertexAttribType);
- this->setHasExplicitLocalCoords();
}
if (fFlags & kCoverageAttribute_GPFlag) {
fInCoverage = &this->addVertexAttrib("inCoverage", kHalf_GrVertexAttribType);
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index acd122eef5..a12ab0058d 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -22,15 +22,10 @@ public:
GrGeometryProcessor(ClassID classID)
: INHERITED(classID)
, fWillUseGeoShader(false)
- , fLocalCoordsType(kUnused_LocalCoordsType)
, fSampleShading(0.0) {}
bool willUseGeoShader() const final { return fWillUseGeoShader; }
- bool hasExplicitLocalCoords() const final {
- return kHasExplicit_LocalCoordsType == fLocalCoordsType;
- }
-
/**
* Returns the minimum fraction of samples for which the fragment shader will be run. For
* instance, if sampleShading is 0.5 in MSAA16 mode, the fragment shader will run a minimum of
@@ -40,36 +35,12 @@ public:
protected:
void setWillUseGeoShader() { fWillUseGeoShader = true; }
-
- /**
- * If a GrFragmentProcessor in the GrPipeline needs localCoods, we will provide them in one of
- * three ways
- * 1) LocalCoordTransform * Position - in Shader
- * 2) LocalCoordTransform * ExplicitLocalCoords- in Shader
- * 3) A transformation on the CPU uploaded via vertex attribute
- */
- enum LocalCoordsType {
- kUnused_LocalCoordsType,
- kHasExplicit_LocalCoordsType,
- kHasTransformed_LocalCoordsType
- };
-
- void setHasExplicitLocalCoords() {
- SkASSERT(kUnused_LocalCoordsType == fLocalCoordsType);
- fLocalCoordsType = kHasExplicit_LocalCoordsType;
- }
- void setHasTransformedLocalCoords() {
- SkASSERT(kUnused_LocalCoordsType == fLocalCoordsType);
- fLocalCoordsType = kHasTransformed_LocalCoordsType;
- }
-
void setSampleShading(float sampleShading) {
fSampleShading = sampleShading;
}
private:
bool fWillUseGeoShader;
- LocalCoordsType fLocalCoordsType;
float fSampleShading;
typedef GrPrimitiveProcessor INHERITED;
diff --git a/src/gpu/GrPathProcessor.h b/src/gpu/GrPathProcessor.h
index 581bd5052f..72e5168a4f 100644
--- a/src/gpu/GrPathProcessor.h
+++ b/src/gpu/GrPathProcessor.h
@@ -40,8 +40,6 @@ public:
private:
GrPathProcessor(GrColor, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);
- bool hasExplicitLocalCoords() const override { return false; }
-
GrColor fColor;
const SkMatrix fViewMatrix;
const SkMatrix fLocalMatrix;
diff --git a/src/gpu/GrPrimitiveProcessor.cpp b/src/gpu/GrPrimitiveProcessor.cpp
index b981977af3..7d1e1a644e 100644
--- a/src/gpu/GrPrimitiveProcessor.cpp
+++ b/src/gpu/GrPrimitiveProcessor.cpp
@@ -10,16 +10,6 @@
#include "GrCoordTransform.h"
/**
- * The key for an individual coord transform is made up of a matrix type, and a bit that indicates
- * the source of the input coords.
- */
-enum {
- kMatrixTypeKeyBits = 1,
- kPositionCoords_Flag = 1 << kMatrixTypeKeyBits,
- kTransformKeyBits = kMatrixTypeKeyBits + 1,
-};
-
-/**
* We specialize the vertex code for each of these matrix types.
*/
enum MatrixType {
@@ -39,13 +29,7 @@ GrPrimitiveProcessor::getTransformKey(const SkTArray<const GrCoordTransform*, tr
} else {
key |= kNoPersp_MatrixType;
}
-
- if (!this->hasExplicitLocalCoords()) {
- key |= kPositionCoords_Flag;
- }
-
- key <<= kTransformKeyBits * t;
-
+ key <<= t;
SkASSERT(0 == (totalKey & key)); // keys for each transform ought not to overlap
totalKey |= key;
}
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h
index 4da4ee3e6f..c4303da4a6 100644
--- a/src/gpu/GrPrimitiveProcessor.h
+++ b/src/gpu/GrPrimitiveProcessor.h
@@ -157,7 +157,6 @@ private:
void removeRefs() const override { GrResourceIOProcessor::removeRefs(); }
void pendingIOComplete() const override { GrResourceIOProcessor::pendingIOComplete(); }
void notifyRefCntIsZero() const final {}
- virtual bool hasExplicitLocalCoords() const = 0;
SkSTArray<8, Attribute> fAttribs;
int fVertexStride = 0;