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

Side by Side Diff: tools/gpuveto.cpp

Issue 1671193002: Make SkPicture/SkImageGenerator default to SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move ImageGenerator impl into ktx code to share with nanobench Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « tools/dump_record.cpp ('k') | tools/lua/lua_pictures.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "LazyDecodeBitmap.h"
9 #include "SkCommandLineFlags.h" 8 #include "SkCommandLineFlags.h"
10 #include "SkPicture.h" 9 #include "SkPicture.h"
11 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
12 #include "SkStream.h" 11 #include "SkStream.h"
13 12
14 DEFINE_string2(readFile, r, "", "skp file to process."); 13 DEFINE_string2(readFile, r, "", "skp file to process.");
15 DEFINE_bool2(quiet, q, false, "quiet"); 14 DEFINE_bool2(quiet, q, false, "quiet");
16 15
17 // This tool just loads a single skp, replays into a new SkPicture (to 16 // This tool just loads a single skp, replays into a new SkPicture (to
18 // regenerate the GPU-specific tracking information) and reports 17 // regenerate the GPU-specific tracking information) and reports
(...skipping 16 matching lines...) Expand all
35 } 34 }
36 35
37 SkFILEStream inputStream(FLAGS_readFile[0]); 36 SkFILEStream inputStream(FLAGS_readFile[0]);
38 if (!inputStream.isValid()) { 37 if (!inputStream.isValid()) {
39 if (!FLAGS_quiet) { 38 if (!FLAGS_quiet) {
40 SkDebugf("Couldn't open file\n"); 39 SkDebugf("Couldn't open file\n");
41 } 40 }
42 return kError; 41 return kError;
43 } 42 }
44 43
45 SkPicture::InstallPixelRefProc proc = &sk_tools::LazyDecodeBitmap; 44 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream));
46
47 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream, pr oc));
48 if (nullptr == picture.get()) { 45 if (nullptr == picture.get()) {
49 if (!FLAGS_quiet) { 46 if (!FLAGS_quiet) {
50 SkDebugf("Could not read the SkPicture\n"); 47 SkDebugf("Could not read the SkPicture\n");
51 } 48 }
52 return kError; 49 return kError;
53 } 50 }
54 51
55 // The SkPicture tracking information is only generated during recording 52 // The SkPicture tracking information is only generated during recording
56 // an isn't serialized. Replay the picture to regenerated the tracking data. 53 // an isn't serialized. Replay the picture to regenerated the tracking data.
57 SkPictureRecorder recorder; 54 SkPictureRecorder recorder;
(...skipping 13 matching lines...) Expand all
71 SkDebugf("gpuveto is only useful when GPU rendering is enabled\n"); 68 SkDebugf("gpuveto is only useful when GPU rendering is enabled\n");
72 return kError; 69 return kError;
73 #endif 70 #endif
74 } 71 }
75 72
76 #if !defined SK_BUILD_FOR_IOS 73 #if !defined SK_BUILD_FOR_IOS
77 int main(int argc, char * const argv[]) { 74 int main(int argc, char * const argv[]) {
78 return tool_main(argc, (char**) argv); 75 return tool_main(argc, (char**) argv);
79 } 76 }
80 #endif 77 #endif
OLDNEW
« no previous file with comments | « tools/dump_record.cpp ('k') | tools/lua/lua_pictures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698