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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 renderer.setup(); | 200 renderer.setup(); |
201 renderer.enableWrites(); | 201 renderer.enableWrites(); |
202 | 202 |
203 bool success = renderer.render(out); | 203 bool success = renderer.render(out); |
204 if (!success) { | 204 if (!success) { |
205 SkDebugf("Failed to render %s\n", inputFilename.c_str()); | 205 SkDebugf("Failed to render %s\n", inputFilename.c_str()); |
206 } | 206 } |
207 | 207 |
| 208 if (FLAGS_preprocess) { |
| 209 if (NULL != renderer.getCanvas()) { |
| 210 renderer.getCanvas()->EXPERIMENTAL_purge(renderer.getPicture()); |
| 211 } |
| 212 } |
| 213 |
208 renderer.end(); | 214 renderer.end(); |
209 | 215 |
210 SkDELETE(picture); | 216 SkDELETE(picture); |
211 return success; | 217 return success; |
212 } | 218 } |
213 | 219 |
214 static inline int getByte(uint32_t value, int index) { | 220 static inline int getByte(uint32_t value, int index) { |
215 SkASSERT(0 <= index && index < 4); | 221 SkASSERT(0 <= index && index < 4); |
216 return (value >> (index * 8)) & 0xFF; | 222 return (value >> (index * 8)) & 0xFF; |
217 } | 223 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 488 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
483 } | 489 } |
484 return 0; | 490 return 0; |
485 } | 491 } |
486 | 492 |
487 #if !defined SK_BUILD_FOR_IOS | 493 #if !defined SK_BUILD_FOR_IOS |
488 int main(int argc, char * const argv[]) { | 494 int main(int argc, char * const argv[]) { |
489 return tool_main(argc, (char**) argv); | 495 return tool_main(argc, (char**) argv); |
490 } | 496 } |
491 #endif | 497 #endif |
OLD | NEW |