From b681e8cf20dddd6eb2354e57f6652b2b980fe0ad Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 22 Dec 2016 09:16:57 -0500 Subject: [PATCH] Add an extra pixel to the distance field path renderer bounds. Cherry-pick to M56 BUG=chromium:663701 BUG=skia:5989 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5086 Change-Id: Ie97f46b108f54c711c5928b11a9921be38356f8d Reviewed-on: https://skia-review.googlesource.com/5086 Reviewed-by: Jim Van Verth Commit-Queue: Brian Salomon Cherry-pick to M55 NOTREECHECKS=true NOTRY=true NOPRESUBMIT=true Change-Id: I3f8e5de782846447c6f809c3284c5081b5d7a283 Reviewed-on: https://skia-review.googlesource.com/5267 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon Reviewed-on: https://skia-review.googlesource.com/6412 --- src/gpu/batches/GrAADistanceFieldPathRenderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index bea604d..99599a4 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -145,6 +145,11 @@ public: // Compute bounds this->setTransformedBounds(shape.bounds(), viewMatrix, HasAABloat::kYes, IsZeroArea::kNo); + // There is currently an issue where we may produce 2 pixels worth of AA around the path. + // A workaround is to outset the bounds by 1 in device space. (skbug.com/5989) + SkRect bounds = this->bounds(); + bounds.outset(1.f, 1.f); + this->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kNo); } const char* name() const override { return "AADistanceFieldPathBatch"; } -- 2.7.4