Index: src/utils/debugger/SkDrawCommand.cpp |
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp |
index 20aad3b9a510b6824d92b63a60d71034631e7d29..99c120bb7f6e3e08611384433cd75ec30b8b6324 100644 |
--- a/src/utils/debugger/SkDrawCommand.cpp |
+++ b/src/utils/debugger/SkDrawCommand.cpp |
@@ -100,10 +100,13 @@ void xlate_and_scale_to_bounds(SkCanvas* canvas, const SkRect& bounds) { |
void render_path(SkCanvas* canvas, const SkPath& path) { |
canvas->clear(0xFFFFFFFF); |
- canvas->save(); |
const SkRect& bounds = path.getBounds(); |
+ if (bounds.isEmpty()) { |
+ return; |
+ } |
+ SkAutoCanvasRestore acr(canvas, true); |
xlate_and_scale_to_bounds(canvas, bounds); |
SkPaint p; |
@@ -111,7 +114,6 @@ void render_path(SkCanvas* canvas, const SkPath& path) { |
p.setStyle(SkPaint::kStroke_Style); |
canvas->drawPath(path, p); |
- canvas->restore(); |
} |
void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRect = nullptr) { |