aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp')
-rw-r--r--src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp b/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp
index f933030177..b1d886cf8c 100644
--- a/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp
+++ b/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp
@@ -52,9 +52,10 @@ protected:
int numInputPoints = proc.numInputPoints();
SkASSERT(3 == numInputPoints || 4 == numInputPoints);
- const char* posValues = (4 == numInputPoints) ? "sk_Position" : "sk_Position.xyz";
+ int inputWidth = (4 == numInputPoints || proc.hasInputWeight()) ? 4 : 3;
+ const char* posValues = (4 == inputWidth) ? "sk_Position" : "sk_Position.xyz";
g->codeAppendf("float%ix2 pts = transpose(float2x%i(sk_in[0].%s, sk_in[1].%s));",
- numInputPoints, numInputPoints, posValues, posValues);
+ inputWidth, inputWidth, posValues, posValues);
GrShaderVar wind("wind", kHalf_GrSLType);
g->declareGlobal(wind);
@@ -389,8 +390,7 @@ public:
void GrCCCoverageProcessor::initGS() {
SkASSERT(Impl::kGeometryShader == fImpl);
- if (PrimitiveType::kCubics == fPrimitiveType ||
- PrimitiveType::kWeightedTriangles == fPrimitiveType) {
+ if (4 == this->numInputPoints() || this->hasInputWeight()) {
this->addVertexAttrib("x_or_y_values", kFloat4_GrVertexAttribType);
SkASSERT(sizeof(QuadPointInstance) == this->getVertexStride() * 2);
SkASSERT(offsetof(QuadPointInstance, fY) == this->getVertexStride());