From 704aad8efb321eb6540078ae327e4a424cf3e384 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 23 Mar 2017 14:01:37 -0400 Subject: fix skia path debug SHOW_SKIA_PATH code had bit-rotted. R=dsinclair@chromium.org BUG= Change-Id: I8961853aa0373fb0a04f829b8e78722197e8f5af Reviewed-on: https://pdfium-review.googlesource.com/3122 Reviewed-by: dsinclair Commit-Queue: dsinclair --- core/fxge/skia/fx_skia_device.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'core/fxge/skia') diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 53432224a5..8987b33ae4 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -173,38 +173,27 @@ void DebugShowCanvasMatrix(const SkCanvas* canvas) { void DebugShowSkiaPath(const SkPath& path) { #if SHOW_SKIA_PATH - char buffer[4096]; - sk_bzero(buffer, sizeof(buffer)); - SkMemoryWStream stream(buffer, sizeof(buffer)); + SkDynamicMemoryWStream stream; path.dump(&stream, false, false); - printf("%s", buffer); + std::unique_ptr storage; + storage.reset(FX_Alloc(char, stream.bytesWritten())); + stream.copyTo(storage.get()); + printf("%s", storage.get()); #endif // SHOW_SKIA_PATH } void DebugShowCanvasClip(const SkCanvas* canvas) { #if SHOW_SKIA_PATH - SkRect local; - SkIRect device; - canvas->getClipBounds(&local); + SkRect local = canvas->getLocalClipBounds(); + SkIRect device = canvas->getDeviceClipBounds(); + printf("local bounds %g %g %g %g\n", local.fLeft, local.fTop, local.fRight, local.fBottom); - canvas->getClipDeviceBounds(&device); printf("device bounds %d %d %d %d\n", device.fLeft, device.fTop, device.fRight, device.fBottom); #endif // SHOW_SKIA_PATH } -#if SHOW_SKIA_PATH -void DebugShowSkiaPaint(const SkPaint& paint) { - if (SkPaint::kFill_Style == paint.getStyle()) { - printf("fill 0x%08x\n", paint.getColor()); - } else { - printf("stroke 0x%08x width %g\n", paint.getColor(), - paint.getStrokeWidth()); - } -} -#endif // SHOW_SKIA_PATH - void DebugShowSkiaDrawPath(const SkCanvas* canvas, const SkPaint& paint, const SkPath& path) { -- cgit v1.2.3