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

Side by Side Diff: tools/skhello.cpp

Issue 24811002: Update the SkDocument interface to allow for 1) abort won't emit pdf, 2) close can report success/f… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
« src/pdf/SkPDFDevice.cpp ('K') | « tools/render_pdfs_main.cpp ('k') | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 30 matching lines...) Expand all
41 SkFILEWStream stream(path); 41 SkFILEWStream stream(path);
42 return stream.write(data->data(), data->size()); 42 return stream.write(data->data(), data->size());
43 } 43 }
44 44
45 static bool do_document(int w, int h, const char path[], const char text[], 45 static bool do_document(int w, int h, const char path[], const char text[],
46 const SkPaint& paint) { 46 const SkPaint& paint) {
47 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path)); 47 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path));
48 if (doc.get()) { 48 if (doc.get()) {
49 SkScalar width = SkIntToScalar(w); 49 SkScalar width = SkIntToScalar(w);
50 SkScalar height = SkIntToScalar(h); 50 SkScalar height = SkIntToScalar(h);
51 doDraw(doc->beginPage(width, height, NULL), paint, text); 51 doDraw(doc->beginPage(SkSize::Make(width, height), NULL), paint, text);
52 return true; 52 return true;
53 } 53 }
54 return false; 54 return false;
55 } 55 }
56 56
57 int tool_main(int argc, char** argv); 57 int tool_main(int argc, char** argv);
58 int tool_main(int argc, char** argv) { 58 int tool_main(int argc, char** argv) {
59 SkCommandLineFlags::SetUsage(""); 59 SkCommandLineFlags::SetUsage("");
60 SkCommandLineFlags::Parse(argc, argv); 60 SkCommandLineFlags::Parse(argc, argv);
61 61
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 } 99 }
100 return 0; 100 return 0;
101 } 101 }
102 102
103 #if !defined SK_BUILD_FOR_IOS 103 #if !defined SK_BUILD_FOR_IOS
104 int main(int argc, char * const argv[]) { 104 int main(int argc, char * const argv[]) {
105 return tool_main(argc, (char**) argv); 105 return tool_main(argc, (char**) argv);
106 } 106 }
107 #endif 107 #endif
OLDNEW
« src/pdf/SkPDFDevice.cpp ('K') | « tools/render_pdfs_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698