| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 | 206 |
| 207 renderer.setup(); | 207 renderer.setup(); |
| 208 renderer.enableWrites(); | 208 renderer.enableWrites(); |
| 209 | 209 |
| 210 bool success = renderer.render(out); | 210 bool success = renderer.render(out); |
| 211 if (!success) { | 211 if (!success) { |
| 212 SkDebugf("Failed to render %s\n", inputFilename.c_str()); | 212 SkDebugf("Failed to render %s\n", inputFilename.c_str()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 if (FLAGS_preprocess) { |
| 216 if (NULL != renderer.getCanvas()) { |
| 217 renderer.getCanvas()->EXPERIMENTAL_purge(renderer.getPicture()); |
| 218 } |
| 219 } |
| 220 |
| 215 renderer.end(); | 221 renderer.end(); |
| 216 | 222 |
| 217 SkDELETE(picture); | 223 SkDELETE(picture); |
| 218 return success; | 224 return success; |
| 219 } | 225 } |
| 220 | 226 |
| 221 static inline int getByte(uint32_t value, int index) { | 227 static inline int getByte(uint32_t value, int index) { |
| 222 SkASSERT(0 <= index && index < 4); | 228 SkASSERT(0 <= index && index < 4); |
| 223 return (value >> (index * 8)) & 0xFF; | 229 return (value >> (index * 8)) & 0xFF; |
| 224 } | 230 } |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 500 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
| 495 } | 501 } |
| 496 return 0; | 502 return 0; |
| 497 } | 503 } |
| 498 | 504 |
| 499 #if !defined SK_BUILD_FOR_IOS | 505 #if !defined SK_BUILD_FOR_IOS |
| 500 int main(int argc, char * const argv[]) { | 506 int main(int argc, char * const argv[]) { |
| 501 return tool_main(argc, (char**) argv); | 507 return tool_main(argc, (char**) argv); |
| 502 } | 508 } |
| 503 #endif | 509 #endif |
| OLD | NEW |