diff options
Diffstat (limited to 'experimental/sksg/SkSGDraw.cpp')
-rw-r--r-- | experimental/sksg/SkSGDraw.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/experimental/sksg/SkSGDraw.cpp b/experimental/sksg/SkSGDraw.cpp index 14f844a359..33c73a5b2b 100644 --- a/experimental/sksg/SkSGDraw.cpp +++ b/experimental/sksg/SkSGDraw.cpp @@ -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) { |