diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-17 16:28:34 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-17 16:28:34 +0000 |
commit | 5cc90d132220a69c1d5734178d851f9c7cd57f16 (patch) | |
tree | 062e90e9fedda301ae22dfb09ba9a9010c9e1992 /src | |
parent | 90d344adc28412e1128dc995bcfa6415bcd78bb6 (diff) |
Incorporate changes related to Tom's post-hoc comments on the convex path renderer.
git-svn-id: http://skia.googlecode.com/svn/trunk@3045 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrAAConvexPathRenderer.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp index 7260962b18..8cf6c77fcf 100644 --- a/src/gpu/GrAAConvexPathRenderer.cpp +++ b/src/gpu/GrAAConvexPathRenderer.cpp @@ -87,10 +87,13 @@ bool get_segments(const GrPath& path, *quadCnt = 0; *lineCnt = 0; SkPath::Iter iter(path, true); - // This renderer overemphasis very thin paths (every pixel intersected by - // the path will be at least 1/2 on). When the path degenerates to a line - // this makes the path draw as a hairline. This is a pretty glaring error - // so we detect this case and will not draw. + // This renderer overemphasises very thin path regions. We use the distance + // to the path from the sample to compute coverage. Every pixel intersected + // by the path will be hit and the maximum distance is sqrt(2)/2. We don't + // notice that the sample may be close to a very thin area of the path and + // thus should be very light. This is particularly egregious for degenerate + // line paths. We detect paths that are very close to a line (zero area) and + // draw nothing. if (is_path_degenerate(path)) { return false; } @@ -147,8 +150,11 @@ void get_counts(int quadCount, int lineCount, int* vCount, int* iCount) { *iCount = 15 * lineCount + 24 * quadCount; } -// for visual debugging, exagerate the AA smear at the edges -// requires modifying the distance calc in the shader actually shade differently +// This macro can be defined for visual debugging purposes. It exagerates the AA +// smear at the edges by increasing the size of the extruded geometry used for +// AA. However, the coverage value computed in the shader will still go to zero +// at distance > .5 outside the curves. So, the shader code has be modified as +// well to stretch out the AA smear. //#define STRETCH_AA #define STRETCH_FACTOR (20 * SK_Scalar1) |