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

Unified Diff: tools/flatten.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 | « tools/dump_record.cpp ('k') | tools/image_expectations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/flatten.cpp
diff --git a/tools/flatten.cpp b/tools/flatten.cpp
deleted file mode 100644
index 8ba20929fb0f6c79591287991280eab339c5d804..0000000000000000000000000000000000000000
--- a/tools/flatten.cpp
+++ /dev/null
@@ -1,51 +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 "SkData.h"
-#include "SkForceLinking.h"
-#include "SkImageGenerator.h"
-#include "SkPicture.h"
-#include "SkPictureRecorder.h"
-#include "SkStream.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-__SK_FORCE_IMAGE_DECODER_LINKING;
-
-#define ASSERTF(cond, fmt, ...) if (!(cond)) { fprintf(stderr, fmt"\n", __VA_ARGS__); exit(1); }
-
-static bool lazy_decode_bitmap(const void* src, size_t size, SkBitmap* dst) {
- SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, size));
- return encoded && SkDEPRECATED_InstallDiscardablePixelRef(encoded, dst);
-}
-
-int main(int argc, char** argv) {
- ASSERTF(argc == 3, "usage: %s nested.skp flat.skp", argv[0]);
- const char *nestedPath = argv[1],
- *flatPath = argv[2];
-
- // Read nested.skp.
- SkFILEStream stream(nestedPath);
- ASSERTF(stream.isValid(), "Couldn't read %s.", nestedPath);
- SkAutoTUnref<const SkPicture> nested(SkPicture::CreateFromStream(&stream, &lazy_decode_bitmap));
- ASSERTF(nested, "Couldn't parse %s as a picture.", nestedPath);
-
- // Play it back into a new picture using kPlaybackDrawPicture_RecordFlag.
- SkPictureRecorder recorder;
- uint32_t flags = SkPictureRecorder::kPlaybackDrawPicture_RecordFlag;
- nested->playback(recorder.beginRecording(nested->cullRect(), nullptr, flags));
- SkAutoTUnref<const SkPicture> flat(recorder.endRecordingAsPicture());
-
- // Write out that flat.skp
- SkFILEWStream wstream(flatPath);
- ASSERTF(wstream.isValid(), "Could not open %s.", flatPath);
- flat->serialize(&wstream);
- wstream.flush();
-
- return 0;
-}
« no previous file with comments | « tools/dump_record.cpp ('k') | tools/image_expectations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698