summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCary Clark <caryclark@google.com>2017-03-23 14:01:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-23 18:18:08 +0000
commit704aad8efb321eb6540078ae327e4a424cf3e384 (patch)
treeb588c89c0f6f3b0edcddc5ebabd89d6111581e4d
parent80c487809858b74783a00e05cc8164edf4b1307c (diff)
downloadpdfium-704aad8efb321eb6540078ae327e4a424cf3e384.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--core/fxge/skia/fx_skia_device.cpp27
1 files changed, 8 insertions, 19 deletions
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<char, FxFreeDeleter> 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) {