diff options
author | Mike Reed <reed@google.com> | 2017-06-07 13:03:36 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-07 17:34:14 +0000 |
commit | 65cfb5ecbc0343fa344e9e3bd99dab4042e0fc8d (patch) | |
tree | abe2cca40d77569b1918e6a19ddfae3ea57a49b8 /src | |
parent | 5ab7276a35906734b017add5cc37fd8cf477a63b (diff) |
disable coverage optimization for hairlines
The coverage blitter is an optimization of regular blitting to A8.
It can go faster because it never tries to blend with itself... because
it was intended to be called only by fill-path, which is written to
never draw twice in the same place. Hairlines don't make this promise,
so we can use the coverage optimization for hairlines.
Change-Id: I0a4816f886462017ad81378d5928357ef038ae8f
Reviewed-on: https://skia-review.googlesource.com/18666
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkDraw.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkDraw.h b/src/core/SkDraw.h index f2d5946c9e..f2941948b7 100644 --- a/src/core/SkDraw.h +++ b/src/core/SkDraw.h @@ -84,7 +84,9 @@ public: */ void drawPathCoverage(const SkPath& src, const SkPaint& paint, SkBlitter* customBlitter = NULL) const { - this->drawPath(src, paint, NULL, false, true, customBlitter); + bool isHairline = paint.getStyle() == SkPaint::kStroke_Style && + paint.getStrokeWidth() > 0; + this->drawPath(src, paint, NULL, false, !isHairline, customBlitter); } /** Helper function that creates a mask from a path and an optional maskfilter. |