Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Unified Diff: src/svg/skp2svg.cpp

Issue 1416913003: Clean up some dead code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: kill dump-record Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | tools/CopyTilesRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/svg/skp2svg.cpp
diff --git a/src/svg/skp2svg.cpp b/src/svg/skp2svg.cpp
deleted file mode 100644
index 2bfb6871be467c7c95b1c5d9aec293c439cd1697..0000000000000000000000000000000000000000
--- a/src/svg/skp2svg.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "LazyDecodeBitmap.h"
-#include "SkCommandLineFlags.h"
-#include "SkPicture.h"
-#include "SkStream.h"
-#include "SkSVGCanvas.h"
-#include "SkXMLWriter.h"
-
-DEFINE_string2(input, i, "", "input skp file");
-DEFINE_string2(output, o, "", "output svg file (optional)");
-
-// return codes:
-static const int kSuccess = 0;
-static const int kInvalidArgs = 1;
-static const int kIOError = 2;
-static const int kNotAnSKP = 3;
-
-int tool_main(int argc, char** argv);
-int tool_main(int argc, char** argv) {
- SkCommandLineFlags::SetUsage("Converts an SKP file to SVG.");
- SkCommandLineFlags::Parse(argc, argv);
-
- if (FLAGS_input.count() != 1) {
- SkDebugf("Missing input file\n");
- return kInvalidArgs;
- }
-
- SkFILEStream stream(FLAGS_input[0]);
- if (!stream.isValid()) {
- SkDebugf("Couldn't open file: %s\n", FLAGS_input[0]);
- return kIOError;
- }
-
- SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(&stream, &sk_tools::LazyDecodeBitmap));
- if (!SkToBool(pic.get())) {
- SkDebugf("Could not load SKP: %s\n", FLAGS_input[0]);
- return kNotAnSKP;
- }
-
- SkAutoTDelete<SkWStream> outStream;
- if (FLAGS_output.count() > 0) {
- SkFILEWStream* fileStream = new SkFILEWStream(FLAGS_output[0]);
- if (!fileStream->isValid()) {
- SkDebugf("Couldn't open output file for writing: %s\n", FLAGS_output[0]);
- return kIOError;
- }
- outStream.reset(fileStream);
- } else {
- outStream.reset(new SkDebugWStream);
- }
-
- SkAutoTDelete<SkXMLWriter> xmlWriter(new SkXMLStreamWriter(outStream.get()));
- SkAutoTUnref<SkCanvas> svgCanvas(SkSVGCanvas::Create(pic->cullRect(), xmlWriter.get()));
-
- pic->playback(svgCanvas);
-
- return kSuccess;
-}
-
-#if !defined SK_BUILD_FOR_IOS
-int main(int argc, char * const argv[]) {
- return tool_main(argc, (char**) argv);
-}
-#endif
« no previous file with comments | « gyp/tools.gyp ('k') | tools/CopyTilesRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698