Index: src/gpu/GrOvalRenderer.cpp |
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp |
index aec9b76ba85f986236a0382fcb451f84beb5e2c2..d8fd3b8dbd54e381309e68b84b0bc399b1de9cad 100644 |
--- a/src/gpu/GrOvalRenderer.cpp |
+++ b/src/gpu/GrOvalRenderer.cpp |
@@ -83,10 +83,13 @@ public: |
fStroke = stroke; |
} |
+ bool implementsDistanceVector() const override { return true; }; |
+ |
const Attribute* inPosition() const { return fInPosition; } |
const Attribute* inColor() const { return fInColor; } |
const Attribute* inCircleEdge() const { return fInCircleEdge; } |
const SkMatrix& localMatrix() const { return fLocalMatrix; } |
+ |
virtual ~CircleGeometryProcessor() {} |
const char* name() const override { return "CircleEdge"; } |
@@ -134,6 +137,11 @@ public: |
fragBuilder->codeAppend("edgeAlpha *= innerAlpha;"); |
} |
+ if (args.fDistanceVectorName) { |
+ fragBuilder->codeAppendf("%s = %s.z * (normalize(%s.xy) - %s.xy);", |
egdaniel
2016/07/28 17:30:53
I feel like this would read easier as something li
dvonbeck
2016/07/28 17:55:14
That wouldn't work because d is a number from 0-1,
egdaniel
2016/07/28 18:01:52
Ahh yes duh.
Since we do in.z * (1-d) above, lets
dvonbeck
2016/07/29 15:08:55
Done.
|
+ args.fDistanceVectorName, v.vsOut(), v.vsOut(), v.vsOut()); |
egdaniel
2016/07/28 17:30:53
why not us fsIn() like the coverage code above?
dvonbeck
2016/07/29 15:08:55
Done.
|
+ } |
+ |
fragBuilder->codeAppendf("%s = vec4(edgeAlpha);", args.fOutputCoverage); |
} |