OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkDocument.h" | 10 #include "SkDocument.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return replace_filename_extension(path, | 115 return replace_filename_extension(path, |
116 SKP_FILE_EXTENSION, | 116 SKP_FILE_EXTENSION, |
117 PDF_FILE_EXTENSION); | 117 PDF_FILE_EXTENSION); |
118 } | 118 } |
119 | 119 |
120 namespace { | 120 namespace { |
121 // This is a write-only stream. | 121 // This is a write-only stream. |
122 class NullWStream : public SkWStream { | 122 class NullWStream : public SkWStream { |
123 public: | 123 public: |
124 NullWStream() : fBytesWritten(0) { } | 124 NullWStream() : fBytesWritten(0) { } |
125 virtual bool write(const void*, size_t size) SK_OVERRIDE { | 125 bool write(const void*, size_t size) SK_OVERRIDE { |
126 fBytesWritten += size; | 126 fBytesWritten += size; |
127 return true; | 127 return true; |
128 } | 128 } |
129 virtual size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } | 129 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } |
130 size_t fBytesWritten; | 130 size_t fBytesWritten; |
131 }; | 131 }; |
132 } // namespace | 132 } // namespace |
133 | 133 |
134 /** Write the output of pdf renderer to a file. | 134 /** Write the output of pdf renderer to a file. |
135 * @param outputDir Output dir. | 135 * @param outputDir Output dir. |
136 * @param inputFilename The skp file that was read. | 136 * @param inputFilename The skp file that was read. |
137 * @param renderer The object responsible to write the pdf file. | 137 * @param renderer The object responsible to write the pdf file. |
138 */ | 138 */ |
139 static SkWStream* open_stream(const SkString& outputDir, | 139 static SkWStream* open_stream(const SkString& outputDir, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 return -1; | 298 return -1; |
299 } | 299 } |
300 #endif | 300 #endif |
301 return 0; | 301 return 0; |
302 } | 302 } |
303 #if !defined SK_BUILD_FOR_IOS | 303 #if !defined SK_BUILD_FOR_IOS |
304 int main(int argc, char * const argv[]) { | 304 int main(int argc, char * const argv[]) { |
305 return tool_main(argc, (char**) argv); | 305 return tool_main(argc, (char**) argv); |
306 } | 306 } |
307 #endif | 307 #endif |
OLD | NEW |