From fbe0793526526ae47f02c7a011e29c401ef191f4 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Tue, 7 Nov 2017 11:19:52 -0500 Subject: 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 Reviewed-by: Cary Clark --- gm/aaa.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gm/aaa.cpp') 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: -- cgit v1.2.3