aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-06-17 12:08:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-17 12:08:16 -0700
commit887f3979f0c717e69a8b7d169169bc27eb46d3b5 (patch)
tree01f767e11b31e57df3a4f8a9de033e677731c1ff /tools
parent24ad0965404c0bc978f27db27e2f00ebac95239c (diff)
Add EXPERIMENTAL_beginRecording() for SkRecord-based recording.
The interesting stuff is in SkPictureRecorder.{h,cpp}. The rest is mostly moving SkRecord from its own directories into core to avoid circular dependencies in GYP. After plumbing SkRecord all the way through in Picture, I'll delete its old entry point include/record/SkRecording.h. For now it and record.gypi need to stay where they are to keep Chrome building. BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/331573004
Diffstat (limited to 'tools')
-rw-r--r--tools/bench_playback.cpp3
-rw-r--r--tools/bench_record.cpp10
2 files changed, 5 insertions, 8 deletions
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index f07fa8e300..26fa1c7ee8 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -11,10 +11,11 @@
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
-#include "SkRecording.h"
#include "SkStream.h"
#include "SkString.h"
+#include "../include/record/SkRecording.h"
+
#include "BenchTimer.h"
#include "Stats.h"
diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp
index a8d7a8a0e5..0024c2ccdb 100644
--- a/tools/bench_record.cpp
+++ b/tools/bench_record.cpp
@@ -11,7 +11,6 @@
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
-#include "SkRecording.h"
#include "SkStream.h"
#include "SkString.h"
@@ -65,16 +64,13 @@ static SkBBHFactory* parse_FLAGS_bbh() {
}
static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) {
+ SkPictureRecorder recorder;
if (FLAGS_skr) {
- EXPERIMENTAL::SkRecording recording(src.width(), src.height());
- src.draw(recording.canvas());
- // Release and delete the SkPlayback so that recording optimizes its SkRecord.
- SkDELETE(recording.releasePlayback());
+ src.draw(recorder.EXPERIMENTAL_beginRecording(src.width(), src.height(), bbhFactory));
} else {
- SkPictureRecorder recorder;
src.draw(recorder.beginRecording(src.width(), src.height(), bbhFactory));
- SkAutoTUnref<SkPicture> dst(recorder.endRecording());
}
+ SkAutoTUnref<SkPicture> pic(recorder.endRecording());
}
static void bench_record(const SkPicture& src,