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 "LazyDecodeBitmap.h" | 8 #include "LazyDecodeBitmap.h" |
9 #include "CopyTilesRenderer.h" | 9 #include "CopyTilesRenderer.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 SkImageDecoder::Format format = SkImageDecoder::GetStreamFormat(&memStream); | 123 SkImageDecoder::Format format = SkImageDecoder::GetStreamFormat(&memStream); |
124 SkString name = SkStringPrintf("%s_%d%s", gInputFileName.c_str(), gImageNo++
, | 124 SkString name = SkStringPrintf("%s_%d%s", gInputFileName.c_str(), gImageNo++
, |
125 get_suffix_from_format(format)); | 125 get_suffix_from_format(format)); |
126 SkString dir(FLAGS_writePath[0]); | 126 SkString dir(FLAGS_writePath[0]); |
127 outPath = SkOSPath::SkPathJoin(dir.c_str(), name.c_str()); | 127 outPath = SkOSPath::SkPathJoin(dir.c_str(), name.c_str()); |
128 SkFILEWStream fileStream(outPath.c_str()); | 128 SkFILEWStream fileStream(outPath.c_str()); |
129 if (!(fileStream.isValid() && fileStream.write(buffer, size))) { | 129 if (!(fileStream.isValid() && fileStream.write(buffer, size))) { |
130 SkDebugf("Failed to write encoded data to \"%s\"\n", outPath.c_str()); | 130 SkDebugf("Failed to write encoded data to \"%s\"\n", outPath.c_str()); |
131 } | 131 } |
132 // Put in a dummy bitmap. | 132 // Put in a dummy bitmap. |
133 return SkImageDecoder::DecodeStream(&memStream, bitmap, SkBitmap::kNo_Config
, | 133 return SkImageDecoder::DecodeStream(&memStream, bitmap, kUnknown_SkColorType
, |
134 SkImageDecoder::kDecodeBounds_Mode); | 134 SkImageDecoder::kDecodeBounds_Mode); |
135 } | 135 } |
136 | 136 |
137 ////////////////////////////////////////////////////////////////////////////////
//////////////////// | 137 ////////////////////////////////////////////////////////////////////////////////
//////////////////// |
138 | 138 |
139 /** | 139 /** |
140 * Called only by render_picture(). | 140 * Called only by render_picture(). |
141 */ | 141 */ |
142 static bool render_picture_internal(const SkString& inputPath, const SkString* w
ritePath, | 142 static bool render_picture_internal(const SkString& inputPath, const SkString* w
ritePath, |
143 const SkString* mismatchPath, | 143 const SkString* mismatchPath, |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
495 } | 495 } |
496 return 0; | 496 return 0; |
497 } | 497 } |
498 | 498 |
499 #if !defined SK_BUILD_FOR_IOS | 499 #if !defined SK_BUILD_FOR_IOS |
500 int main(int argc, char * const argv[]) { | 500 int main(int argc, char * const argv[]) { |
501 return tool_main(argc, (char**) argv); | 501 return tool_main(argc, (char**) argv); |
502 } | 502 } |
503 #endif | 503 #endif |
OLD | NEW |