aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/aaa.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-11-07 11:19:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-07 16:40:08 +0000
commitfbe0793526526ae47f02c7a011e29c401ef191f4 (patch)
treeeaf42cb086275c5fe0e348eb2f7afdfa5a3fe31c /gm/aaa.cpp
parent63bc48d09323a62c8c67237fc66ad6ec7105e973 (diff)
Correct edges_too_close
If the next edge has 0 fDX, we should add a SLACK = 1 so two edges with fX less than 1 pixel apart should be considered close, and noRealBlitter should be true to force the use of AdditiveBlitter and the cumulation of alpha. The changed GM will show bleed through if SLACK is 0. The artifact without the fix can be seen at: https://fiddle.skia.org/c/f6912f1af6c14e054f5b5935a93380ea Bug: skia: Change-Id: I15f9c3aef25a0357cd11d447e7bf0b4fbac0ce67 Reviewed-on: https://skia-review.googlesource.com/67804 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'gm/aaa.cpp')
-rw-r--r--gm/aaa.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/gm/aaa.cpp b/gm/aaa.cpp
index 614ff84258..4f81fc9a2c 100644
--- a/gm/aaa.cpp
+++ b/gm/aaa.cpp
@@ -123,6 +123,22 @@ protected:
p.setStrokeWidth(5);
canvas->drawPath(path, p);
canvas->restore();
+
+
+ // The following two paths test if we correctly cumulates the alpha on the middle pixel
+ // column where the left rect and the right rect abut.
+ p.setStyle(SkPaint::kFill_Style);
+ canvas->translate(0, 300);
+ path.reset();
+ path.addRect({20, 20, 100.4999f, 100});
+ path.addRect({100.5001f, 20, 200, 100});
+ canvas->drawPath(path, p);
+
+ canvas->translate(300, 0);
+ path.reset();
+ path.addRect({20, 20, 100.1f, 100});
+ path.addRect({100.9f, 20, 200, 100});
+ canvas->drawPath(path, p);
}
private: