From c5ba71d2e5cd426def66fa49dcf003e5b2c98dc7 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Thu, 4 Sep 2014 08:42:50 -0700 Subject: Change SkPicture::draw to playback R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/540963002 --- tools/PictureRenderer.cpp | 4 ++-- tools/bench_pictures_main.cpp | 6 +++--- tools/bench_playback.cpp | 16 ++++++++-------- tools/bench_record.cpp | 4 ++-- tools/dump_record.cpp | 2 +- tools/filtermain.cpp | 2 +- tools/gpuveto.cpp | 6 +++--- tools/render_pictures_main.cpp | 12 ++++++------ 8 files changed, 26 insertions(+), 26 deletions(-) (limited to 'tools') diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp index ed5bdfe612..b2bac003f4 100644 --- a/tools/PictureRenderer.cpp +++ b/tools/PictureRenderer.cpp @@ -220,7 +220,7 @@ void PictureRenderer::buildBBoxHierarchy() { fPicture->cullRect().height(), factory.get(), this->recordFlags()); - fPicture->draw(canvas); + fPicture->playback(canvas); fPicture.reset(recorder.endRecording()); } } @@ -361,7 +361,7 @@ bool RecordPictureRenderer::render(SkBitmap** out) { factory.get(), this->recordFlags()); this->scaleToScaleFactor(canvas); - fPicture->draw(canvas); + fPicture->playback(canvas); SkAutoTUnref picture(recorder.endRecording()); if (!fWritePath.isEmpty()) { // Record the new picture as a new SKP with PNG encoded bitmaps. diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp index 4bb31949c9..2eda73c40f 100644 --- a/tools/bench_pictures_main.cpp +++ b/tools/bench_pictures_main.cpp @@ -201,9 +201,9 @@ static bool run_single_benchmark(const SkString& inputPath, // 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->cullRect().width(), - picture->cullRect().height(), - NULL, 0)); + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), + NULL, 0)); picture.reset(recorder.endRecording()); } diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp index f5bbc12c0a..53c988cd66 100644 --- a/tools/bench_playback.cpp +++ b/tools/bench_playback.cpp @@ -44,12 +44,12 @@ static SkPicture* rerecord(const SkPicture& src, bool skr) { SkTileGridFactory factory(info); SkPictureRecorder recorder; - src.draw(skr ? recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), - src.cullRect().height(), - &factory) - : recorder. DEPRECATED_beginRecording(src.cullRect().width(), - src.cullRect().height(), - &factory)); + src.playback(skr ? recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), + src.cullRect().height(), + &factory) + : recorder. DEPRECATED_beginRecording(src.cullRect().width(), + src.cullRect().height(), + &factory)); return recorder.endRecording(); } @@ -64,7 +64,7 @@ static void bench(SkPMColor* scratch, const SkPicture& src, const char* name) { canvas->clipRect(SkRect::MakeWH(SkIntToScalar(FLAGS_tile), SkIntToScalar(FLAGS_tile))); // Draw once to warm any caches. The first sample otherwise can be very noisy. - picture->draw(canvas.get()); + picture->playback(canvas.get()); WallTimer timer; const double scale = timescale(); @@ -73,7 +73,7 @@ static void bench(SkPMColor* scratch, const SkPicture& src, const char* name) { // We assume timer overhead (typically, ~30ns) is insignificant // compared to draw runtime (at least ~100us, usually several ms). timer.start(); - picture->draw(canvas.get()); + picture->playback(canvas.get()); timer.end(); samples[i] = timer.fWall * scale; } diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp index 45a143f824..fe28e342a4 100644 --- a/tools/bench_record.cpp +++ b/tools/bench_record.cpp @@ -61,11 +61,11 @@ static SkBBHFactory* parse_FLAGS_bbh() { static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) { SkPictureRecorder recorder; if (FLAGS_skr) { - src.draw(recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), + src.playback(recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), src.cullRect().height(), bbhFactory)); } else { - src.draw(recorder. DEPRECATED_beginRecording(src.cullRect().width(), + src.playback(recorder. DEPRECATED_beginRecording(src.cullRect().width(), src.cullRect().height(), bbhFactory)); } diff --git a/tools/dump_record.cpp b/tools/dump_record.cpp index bc1538fdf1..fc2e102623 100644 --- a/tools/dump_record.cpp +++ b/tools/dump_record.cpp @@ -62,7 +62,7 @@ int tool_main(int argc, char** argv) { SkRecord record; SkRecorder canvas(&record, w, h); - src->draw(&canvas); + src->playback(&canvas); if (FLAGS_optimize) { SkRecordOptimize(&record); diff --git a/tools/filtermain.cpp b/tools/filtermain.cpp index a7ed20d928..00854d4e3e 100644 --- a/tools/filtermain.cpp +++ b/tools/filtermain.cpp @@ -679,7 +679,7 @@ static int filter_picture(const SkString& inFile, const SkString& outFile) { SkDebugCanvas debugCanvas(SkScalarCeilToInt(inPicture->cullRect().width()), SkScalarCeilToInt(inPicture->cullRect().height())); - inPicture->draw(&debugCanvas); + inPicture->playback(&debugCanvas); // delete the initial save and restore since replaying the commands will // re-add them diff --git a/tools/gpuveto.cpp b/tools/gpuveto.cpp index bfe3837626..4e9fdebd4b 100644 --- a/tools/gpuveto.cpp +++ b/tools/gpuveto.cpp @@ -55,9 +55,9 @@ int tool_main(int argc, char** argv) { // The SkPicture tracking information is only generated during recording // an isn't serialized. Replay the picture to regenerated the tracking data. SkPictureRecorder recorder; - picture->draw(recorder.beginRecording(picture->cullRect().width(), - picture->cullRect().height(), - NULL, 0)); + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), + NULL, 0)); SkAutoTUnref recorded(recorder.endRecording()); if (recorded->suitableForGpuRasterization(NULL)) { diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp index c9bdf13451..9ec136c1e7 100644 --- a/tools/render_pictures_main.cpp +++ b/tools/render_pictures_main.cpp @@ -184,17 +184,17 @@ static bool render_picture_internal(const SkString& inputPath, const SkString* w // 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->cullRect().width(), - picture->cullRect().height(), - NULL, 0)); + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), + NULL, 0)); picture.reset(recorder.endRecording()); } while (FLAGS_bench_record) { SkPictureRecorder recorder; - picture->draw(recorder.beginRecording(picture->cullRect().width(), - picture->cullRect().height(), - NULL, 0)); + picture->playback(recorder.beginRecording(picture->cullRect().width(), + picture->cullRect().height(), + NULL, 0)); SkAutoTUnref other(recorder.endRecording()); } -- cgit v1.2.3