diff options
author | Brian Osman <brianosman@google.com> | 2018-03-09 15:44:34 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-10 03:29:54 +0000 |
commit | 46fe9c7f6cc772639c0c7b3a71fe889139506841 (patch) | |
tree | 7af51f403bb5cc6ece29881ac9f753b261fc9c3c /tools | |
parent | efd4411c2349dfa595caa74f639c0635285bb245 (diff) |
Remove SkDumpCanvas
Bug: skia:
Change-Id: I045e84f154d0294121a4c1966dcf47c0d7e52934
Reviewed-on: https://skia-review.googlesource.com/113464
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pinspect.cpp | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp deleted file mode 100644 index 29a422257d..0000000000 --- a/tools/pinspect.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2012 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkBitmap.h" -#include "SkCanvas.h" -#include "SkGraphics.h" -#include "SkOSFile.h" -#include "SkPicture.h" -#include "SkStream.h" -#include "SkString.h" -#include "SkDumpCanvas.h" - -static sk_sp<SkPicture> inspect(const char path[]) { - SkFILEStream stream(path); - if (!stream.isValid()) { - printf("-- Can't open '%s'\n", path); - return nullptr; - } - - printf("Opening '%s'...\n", path); - - { - int32_t header[3]; - if (stream.read(header, sizeof(header)) != sizeof(header)) { - printf("-- Failed to read header (12 bytes)\n"); - return nullptr; - } - printf("version:%d width:%d height:%d\n", header[0], header[1], header[2]); - } - - stream.rewind(); - auto pic = SkPicture::MakeFromStream(&stream); - if (nullptr == pic) { - SkDebugf("Could not create SkPicture: %s\n", path); - return nullptr; - } - printf("picture cullRect: [%f %f %f %f]\n", - pic->cullRect().fLeft, pic->cullRect().fTop, - pic->cullRect().fRight, pic->cullRect().fBottom); - return pic; -} - -static void dumpOps(SkPicture* pic) { -#ifdef SK_DEBUG - SkDebugfDumper dumper; - SkDumpCanvas canvas(&dumper); - canvas.drawPicture(pic); -#else - printf("SK_DEBUG mode not enabled\n"); -#endif -} - -int main(int argc, char** argv) { - SkAutoGraphics ag; - if (argc < 2) { - printf("Usage: pinspect [--dump-ops] filename [filename ...]\n"); - return 1; - } - - bool doDumpOps = false; - - int index = 1; - if (!strcmp(argv[index], "--dump-ops")) { - index += 1; - doDumpOps = true; - } - - for (; index < argc; ++index) { - auto pic(inspect(argv[index])); - if (doDumpOps) { - dumpOps(pic.get()); - } - if (index < argc - 1) { - printf("\n"); - } - } - return 0; -} |