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

Unified Diff: bench/PicturePlaybackBench.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
« no previous file with comments | « no previous file | bench/PictureRecordBench.cpp » ('j') | samplecode/SampleTiling.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PicturePlaybackBench.cpp
===================================================================
--- bench/PicturePlaybackBench.cpp (revision 14159)
+++ bench/PicturePlaybackBench.cpp (working copy)
@@ -37,16 +37,15 @@
virtual void onDraw(const int loops, SkCanvas* canvas) {
- SkPicture picture;
+ SkPictureRecorder recorder;
+ SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ this->recordCanvas(pCanvas);
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- SkCanvas* pCanvas = picture.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
- recordCanvas(pCanvas);
- picture.endRecording();
-
const SkPoint translateDelta = getTranslateDelta(loops);
for (int i = 0; i < loops; i++) {
- picture.draw(canvas);
+ picture->draw(canvas);
canvas->translate(translateDelta.fX, translateDelta.fY);
}
}
@@ -71,7 +70,7 @@
public:
TextPlaybackBench() : INHERITED("drawText") { }
protected:
- virtual void recordCanvas(SkCanvas* canvas) {
+ virtual void recordCanvas(SkCanvas* canvas) SK_OVERRIDE {
SkPaint paint;
paint.setTextSize(fTextSize);
paint.setColor(SK_ColorBLACK);
@@ -96,7 +95,7 @@
: INHERITED(drawPosH ? "drawPosTextH" : "drawPosText")
, fDrawPosH(drawPosH) { }
protected:
- virtual void recordCanvas(SkCanvas* canvas) {
+ virtual void recordCanvas(SkCanvas* canvas) SK_OVERRIDE {
SkPaint paint;
paint.setTextSize(fTextSize);
paint.setColor(SK_ColorBLACK);
« no previous file with comments | « no previous file | bench/PictureRecordBench.cpp » ('j') | samplecode/SampleTiling.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698