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

Unified Diff: bench/PictureRecordBench.cpp

Issue 214953003: split SkPictureRecorder out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT (again) 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
Index: bench/PictureRecordBench.cpp
===================================================================
--- bench/PictureRecordBench.cpp (revision 14159)
+++ bench/PictureRecordBench.cpp (working copy)
@@ -51,15 +51,15 @@
protected:
virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
- SkAutoTDelete<SkPicture> picture;
+ SkPictureRecorder recorder;
SkCanvas* canvas = NULL;
const SkPoint translateDelta = getTranslateDelta(loops);
for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
- picture.reset(SkNEW(SkPicture));
- canvas = picture->beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
}
SkColor color = SK_ColorYELLOW + (i % 255);
@@ -120,12 +120,12 @@
virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
SkRandom rand;
SkPaint paint;
- SkAutoTDelete<SkPicture> picture;
+ SkPictureRecorder recorder;
SkCanvas* canvas = NULL;
for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
- picture.reset(SkNEW(SkPicture));
- canvas = picture->beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
}
paint.setColor(rand.nextU());
canvas->drawPaint(paint);
@@ -158,8 +158,8 @@
};
protected:
virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
- SkPicture picture;
- SkCanvas* canvas = picture.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
for (int i = 0; i < loops; i++) {
canvas->drawPaint(fPaint[i % ObjCount]);
}
« no previous file with comments | « bench/PicturePlaybackBench.cpp ('k') | bench/benchmain.cpp » ('j') | samplecode/SampleTiling.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698