Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: tools/render_pictures_main.cpp

Issue 408923002: Add auto purging for SkPicture-related Ganesh resources (esp. layers) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/PictureBenchmark.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
214 renderer.end(); 208 renderer.end();
215 209
216 SkDELETE(picture); 210 SkDELETE(picture);
217 return success; 211 return success;
218 } 212 }
219 213
220 static inline int getByte(uint32_t value, int index) { 214 static inline int getByte(uint32_t value, int index) {
221 SkASSERT(0 <= index && index < 4); 215 SkASSERT(0 <= index && index < 4);
222 return (value >> (index * 8)) & 0xFF; 216 return (value >> (index * 8)) & 0xFF;
223 } 217 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 482 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
489 } 483 }
490 return 0; 484 return 0;
491 } 485 }
492 486
493 #if !defined SK_BUILD_FOR_IOS 487 #if !defined SK_BUILD_FOR_IOS
494 int main(int argc, char * const argv[]) { 488 int main(int argc, char * const argv[]) {
495 return tool_main(argc, (char**) argv); 489 return tool_main(argc, (char**) argv);
496 } 490 }
497 #endif 491 #endif
OLDNEW
« no previous file with comments | « tools/PictureBenchmark.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698