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

Unified Diff: tools/render_pictures_main.cpp

Issue 466733004: Update tools for use of picture stats in GPU optimization decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/render_pictures_main.cpp
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index e2f772908f7f3abde45cc04ce365341821e11c7e..23d973f901092989b2a6c0f64f92d23e7e33a395 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -172,13 +172,21 @@ static bool render_picture_internal(const SkString& inputPath, const SkString* w
SkDebugf("deserializing... %s\n", inputPath.c_str());
- SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc);
+ SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream, proc));
if (NULL == picture) {
SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
return false;
}
+ if (FLAGS_preprocess) {
+ // Because the GPU preprocessing step relies on the in-memory picture
+ // statistics we need to rerecord the picture here
+ SkPictureRecorder recorder;
+ picture->draw(recorder.beginRecording(picture->width(), picture->height(), NULL, 0));
+ picture.reset(recorder.endRecording());
+ }
+
while (FLAGS_bench_record) {
SkPictureRecorder recorder;
picture->draw(recorder.beginRecording(picture->width(), picture->height(), NULL, 0));
@@ -207,7 +215,6 @@ static bool render_picture_internal(const SkString& inputPath, const SkString* w
renderer.end();
- SkDELETE(picture);
return success;
}
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698