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

Unified Diff: tools/bench_record.cpp

Issue 248033002: Rearrange SkRecord public API to fit better with cc/resources/picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add forgetRecord() Created 6 years, 8 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
« include/record/SkRecording.h ('K') | « tests/RecordingTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_record.cpp
diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp
index b27aa5656d908b41e88a908625cf09deb2657f2a..63139d69fd3379d2c27f53107731ae1d859696ea 100644
--- a/tools/bench_record.cpp
+++ b/tools/bench_record.cpp
@@ -62,12 +62,12 @@ static void bench_record(SkPicture* src, const char* name, SkBBHFactory* bbhFact
for (int i = 0; i < FLAGS_loops; i++) {
if (FLAGS_skr) {
- using EXPERIMENTAL::SkRecording;
- SkRecording* recording = SkRecording::Create(width, height);
+ EXPERIMENTAL::SkRecording recording(width, height);
if (NULL != src) {
- src->draw(recording->canvas());
+ src->draw(recording.canvas());
}
- SkDELETE(SkRecording::Delete(recording)); // delete the SkPlayback*.
+ // Release and delete the SkPlayback so that recording optimizes its SkRecord.
+ SkDELETE(recording.releasePlayback());
} else {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(width, height, bbhFactory, FLAGS_flags);
« include/record/SkRecording.h ('K') | « tests/RecordingTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698