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

Unified Diff: bench/PictureRecordBench.cpp

Issue 618303002: Remove DEPRECATED_beginRecording(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up benches Created 6 years, 3 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 | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PictureRecordBench.cpp
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index ef5361d20ac43d2905a955a936582bc5f2112544..50fabe17704aa93f74161acb8e469f733e6318a2 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:
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698