[sksg] Skip zero-width strokes
Zero-width strokes imply hairline in Skia, but in other models (e.g. Lottie) they are simply ignored. The latter approach avoids discontinuities when width -> 0, so let's make it the default for sksg. TBR= Change-Id: I957a873c0e6468e21372115ed18cc7316fd2e7d1 Reviewed-on: https://skia-review.googlesource.com/97661 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
b7235a9b73
commit
739641580f
@ -26,7 +26,13 @@ Draw::~Draw() {
|
||||
}
|
||||
|
||||
void Draw::onRender(SkCanvas* canvas) const {
|
||||
fGeometry->draw(canvas, fPaint->makePaint());
|
||||
const auto& paint = fPaint->makePaint();
|
||||
const auto skipDraw = paint.nothingToDraw() ||
|
||||
(paint.getStyle() == SkPaint::kStroke_Style && paint.getStrokeWidth() <= 0);
|
||||
|
||||
if (!skipDraw) {
|
||||
fGeometry->draw(canvas, paint);
|
||||
}
|
||||
}
|
||||
|
||||
SkRect Draw::onRevalidate(InvalidationController* ic, const SkMatrix& ctm) {
|
||||
|
Loading…
Reference in New Issue
Block a user