diff options
author | 2014-10-01 09:29:35 -0700 | |
---|---|---|
committer | 2014-10-01 09:29:35 -0700 | |
commit | 8e12656096fceeed8b3cc4284d57dea04893b455 (patch) | |
tree | 43b0ae13764b93af263e01d89d269c7bfec84370 /bench | |
parent | 23cd4d2d1adecff9c88fa06b7a0a74d52c11fc75 (diff) |
Remove DEPRECATED_beginRecording().
This removes:
1) ability to record old pictures with SkPictureRecorder;
2) a couple tests specific to the old backend.
The functionality of DEPRECATED_beginRecording() now lives in
(private) SkPicture::Backport(), which is the only place we
need it now.
BUG=skia:
TBR=reed@google.com
Review URL: https://codereview.chromium.org/618303002
Diffstat (limited to 'bench')
-rw-r--r-- | bench/PictureRecordBench.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp index ef5361d20a..50fabe1770 100644 --- a/bench/PictureRecordBench.cpp +++ b/bench/PictureRecordBench.cpp @@ -53,14 +53,14 @@ public: protected: virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE { SkPictureRecorder recorder; - SkCanvas* canvas = NULL; + SkCanvas* canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT); const SkPoint translateDelta = getTranslateDelta(loops); for (int i = 0; i < loops; i++) { if (0 == i % kMaxLoopsPerCanvas) { SkAutoTUnref<SkPicture> picture(recorder.endRecording()); - canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0); + canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT); } SkColor color = SK_ColorYELLOW + (i % 255); @@ -98,6 +98,7 @@ protected: canvas->restore(); canvas->translate(translateDelta.fX, translateDelta.fY); } + SkAutoTUnref<SkPicture> cleanup(recorder.endRecording()); } SkPoint getTranslateDelta(int M) { @@ -122,15 +123,16 @@ protected: SkRandom rand; SkPaint paint; SkPictureRecorder recorder; - SkCanvas* canvas = NULL; + SkCanvas* canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT); for (int i = 0; i < loops; i++) { if (0 == i % kMaxLoopsPerCanvas) { SkAutoTUnref<SkPicture> picture(recorder.endRecording()); - canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0); + canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT); } paint.setColor(rand.nextU()); canvas->drawPaint(paint); } + SkAutoTUnref<SkPicture> cleanup(recorder.endRecording()); } private: |