Skip to content

Commit 1dced86

Browse files
reed-at-googleSkia Commit-Bot
authored andcommitted
Revert "Don't let neighboring radii in GrAAFillRRectOp get too close"
This reverts commit 778edc8. Reason for revert: speculative, to see if chrome rolls Original change's description: > Don't let neighboring radii in GrAAFillRRectOp get too close > > Since each corner uses a different reference point, it's possible that > FP rounding can cause the edges of very close radii on a common edge > to accidentally overlap. This can cause a pixel to be drawn/blended > more than once. This CL addresses the issue by not allowing > neighboring radii on a common edge to get closer than 1/16 pixel from > one another. > > Bug: skia:8562 > Change-Id: Ifda97c9a4c3973405f86f7fc6846a4073b3ab581 > Reviewed-on: https://skia-review.googlesource.com/c/173036 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,csmartdalton@google.com Change-Id: Ica14341e38bc0da649f0f0ade70692b0372f1c78 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:8562 Reviewed-on: https://skia-review.googlesource.com/c/173160 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
1 parent 600ed12 commit 1dced86

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/gpu/ops/GrAAFillRRectOp.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,8 @@ class GrAAFillRRectOp::Processor::Impl : public GrGLSLGeometryProcessor {
325325
v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;");
326326

327327
// Identify our radii.
328-
v->codeAppend("float4 radii_and_neighbors = radii_selector"
329-
"* float4x4(radii_x, radii_y, radii_x.yxwz, radii_y.wzyx);");
330-
v->codeAppend("float2 radii = radii_and_neighbors.xy;");
331-
v->codeAppend("float2 neighbor_radii = radii_and_neighbors.zw;");
328+
v->codeAppend("float2 radii = float2(dot(radii_selector, radii_x), "
329+
"dot(radii_selector, radii_y));");
332330

333331
v->codeAppend("if (any(greaterThan(aa_bloatradius, float2(1)))) {");
334332
// The rrect is more narrow than an AA coverage ramp. We can't draw as-is
@@ -349,14 +347,11 @@ class GrAAFillRRectOp::Processor::Impl : public GrGLSLGeometryProcessor {
349347
v->codeAppend( "radius_outset = floor(abs(radius_outset)) * radius_outset;");
350348
v->codeAppend( "is_linear_coverage = 1;");
351349
v->codeAppend("} else {");
352-
// Don't let radii get smaller than a pixel.
350+
// Don't let actual arc radii get smaller than a pixel.
353351
v->codeAppend( "radii = clamp(radii, pixellength, 2 - pixellength);");
354-
v->codeAppend( "neighbor_radii = clamp(neighbor_radii, pixellength, 2 - pixellength);");
355-
// Don't let neighboring radii get closer together than 1/16 pixel.
356-
v->codeAppend( "float2 spacing = 2 - radii - neighbor_radii;");
357-
v->codeAppend( "float2 extra_pad = max(pixellength * .0625 - spacing, float2(0));");
358-
v->codeAppend( "radii -= extra_pad * .5;");
359352
v->codeAppend("}");
353+
// Bias radii slightly inward to avoid accidental overlap of geometries from fp rounding.
354+
v->codeAppend("radii -= aa_bloatradius * 1e-3;");
360355

361356
// Find our vertex position, adjusted for radii and bloated for AA. Our rect is drawn in
362357
// normalized [-1,-1,+1,+1] space.

0 commit comments

Comments
 (0)