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

Side by Side Diff: bench/PicturePlaybackBench.cpp

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | bench/PictureRecordBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 20 matching lines...) Expand all
31 TEXT_SIZE = 10 31 TEXT_SIZE = 10
32 }; 32 };
33 protected: 33 protected:
34 virtual const char* onGetName() { 34 virtual const char* onGetName() {
35 return fName.c_str(); 35 return fName.c_str();
36 } 36 }
37 37
38 virtual void onDraw(const int loops, SkCanvas* canvas) { 38 virtual void onDraw(const int loops, SkCanvas* canvas) {
39 39
40 SkPictureRecorder recorder; 40 SkPictureRecorder recorder;
41 SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGH T); 41 SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGH T, NULL, 0);
42 this->recordCanvas(pCanvas); 42 this->recordCanvas(pCanvas);
43 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 43 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
44 44
45 const SkPoint translateDelta = getTranslateDelta(loops); 45 const SkPoint translateDelta = getTranslateDelta(loops);
46 46
47 for (int i = 0; i < loops; i++) { 47 for (int i = 0; i < loops; i++) {
48 picture->draw(canvas); 48 picture->draw(canvas);
49 canvas->translate(translateDelta.fX, translateDelta.fY); 49 canvas->translate(translateDelta.fX, translateDelta.fY);
50 } 50 }
51 } 51 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 bool fDrawPosH; 131 bool fDrawPosH;
132 typedef PicturePlaybackBench INHERITED; 132 typedef PicturePlaybackBench INHERITED;
133 }; 133 };
134 134
135 135
136 /////////////////////////////////////////////////////////////////////////////// 136 ///////////////////////////////////////////////////////////////////////////////
137 137
138 DEF_BENCH( return new TextPlaybackBench(); ) 138 DEF_BENCH( return new TextPlaybackBench(); )
139 DEF_BENCH( return new PosTextPlaybackBench(true); ) 139 DEF_BENCH( return new PosTextPlaybackBench(true); )
140 DEF_BENCH( return new PosTextPlaybackBench(false); ) 140 DEF_BENCH( return new PosTextPlaybackBench(false); )
OLDNEW
« no previous file with comments | « no previous file | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698