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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return replace_filename_extension(path, | 91 return replace_filename_extension(path, |
92 SKP_FILE_EXTENSION, | 92 SKP_FILE_EXTENSION, |
93 PDF_FILE_EXTENSION); | 93 PDF_FILE_EXTENSION); |
94 } | 94 } |
95 | 95 |
96 namespace { | 96 namespace { |
97 // This is a write-only stream. | 97 // This is a write-only stream. |
98 class NullWStream : public SkWStream { | 98 class NullWStream : public SkWStream { |
99 public: | 99 public: |
100 NullWStream() : fBytesWritten(0) { } | 100 NullWStream() : fBytesWritten(0) { } |
101 bool write(const void*, size_t size) SK_OVERRIDE { | 101 bool write(const void*, size_t size) override { |
102 fBytesWritten += size; | 102 fBytesWritten += size; |
103 return true; | 103 return true; |
104 } | 104 } |
105 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } | 105 size_t bytesWritten() const override { return fBytesWritten; } |
106 size_t fBytesWritten; | 106 size_t fBytesWritten; |
107 }; | 107 }; |
108 } // namespace | 108 } // namespace |
109 | 109 |
110 /** Write the output of pdf renderer to a file. | 110 /** Write the output of pdf renderer to a file. |
111 * @param outputDir Output dir. | 111 * @param outputDir Output dir. |
112 * @param inputFilename The skp file that was read. | 112 * @param inputFilename The skp file that was read. |
113 * @param renderer The object responsible to write the pdf file. | 113 * @param renderer The object responsible to write the pdf file. |
114 */ | 114 */ |
115 static SkWStream* open_stream(const SkString& outputDir, | 115 static SkWStream* open_stream(const SkString& outputDir, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return -1; | 273 return -1; |
274 } | 274 } |
275 #endif | 275 #endif |
276 return 0; | 276 return 0; |
277 } | 277 } |
278 #if !defined SK_BUILD_FOR_IOS | 278 #if !defined SK_BUILD_FOR_IOS |
279 int main(int argc, char * const argv[]) { | 279 int main(int argc, char * const argv[]) { |
280 return tool_main(argc, (char**) argv); | 280 return tool_main(argc, (char**) argv); |
281 } | 281 } |
282 #endif | 282 #endif |
OLD | NEW |