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

Side by Side Diff: bench/PicturePlaybackBench.cpp

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 years, 6 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
« no previous file with comments | « bench/PerlinNoiseBench.cpp ('k') | 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 "Benchmark.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"
11 #include "SkPicture.h" 11 #include "SkPicture.h"
12 #include "SkPictureRecorder.h" 12 #include "SkPictureRecorder.h"
13 #include "SkPoint.h" 13 #include "SkPoint.h"
14 #include "SkRect.h" 14 #include "SkRect.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 16
17 // This is designed to emulate about 4 screens of textual content 17 // This is designed to emulate about 4 screens of textual content
18 18
19 19
20 class PicturePlaybackBench : public SkBenchmark { 20 class PicturePlaybackBench : public Benchmark {
21 public: 21 public:
22 PicturePlaybackBench(const char name[]) { 22 PicturePlaybackBench(const char name[]) {
23 fName.printf("picture_playback_%s", name); 23 fName.printf("picture_playback_%s", name);
24 fPictureWidth = SkIntToScalar(PICTURE_WIDTH); 24 fPictureWidth = SkIntToScalar(PICTURE_WIDTH);
25 fPictureHeight = SkIntToScalar(PICTURE_HEIGHT); 25 fPictureHeight = SkIntToScalar(PICTURE_HEIGHT);
26 fTextSize = SkIntToScalar(TEXT_SIZE); 26 fTextSize = SkIntToScalar(TEXT_SIZE);
27 } 27 }
28 28
29 enum { 29 enum {
30 PICTURE_WIDTH = 1000, 30 PICTURE_WIDTH = 1000,
(...skipping 25 matching lines...) Expand all
56 SkIPoint canvasSize = onGetSize(); 56 SkIPoint canvasSize = onGetSize();
57 return SkPoint::Make(SkIntToScalar((PICTURE_WIDTH - canvasSize.fX)/N), 57 return SkPoint::Make(SkIntToScalar((PICTURE_WIDTH - canvasSize.fX)/N),
58 SkIntToScalar((PICTURE_HEIGHT- canvasSize.fY)/N)); 58 SkIntToScalar((PICTURE_HEIGHT- canvasSize.fY)/N));
59 } 59 }
60 60
61 SkString fName; 61 SkString fName;
62 SkScalar fPictureWidth; 62 SkScalar fPictureWidth;
63 SkScalar fPictureHeight; 63 SkScalar fPictureHeight;
64 SkScalar fTextSize; 64 SkScalar fTextSize;
65 private: 65 private:
66 typedef SkBenchmark INHERITED; 66 typedef Benchmark INHERITED;
67 }; 67 };
68 68
69 69
70 class TextPlaybackBench : public PicturePlaybackBench { 70 class TextPlaybackBench : public PicturePlaybackBench {
71 public: 71 public:
72 TextPlaybackBench() : INHERITED("drawText") { } 72 TextPlaybackBench() : INHERITED("drawText") { }
73 protected: 73 protected:
74 virtual void recordCanvas(SkCanvas* canvas) SK_OVERRIDE { 74 virtual void recordCanvas(SkCanvas* canvas) SK_OVERRIDE {
75 SkPaint paint; 75 SkPaint paint;
76 paint.setTextSize(fTextSize); 76 paint.setTextSize(fTextSize);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 bool fDrawPosH; 132 bool fDrawPosH;
133 typedef PicturePlaybackBench INHERITED; 133 typedef PicturePlaybackBench INHERITED;
134 }; 134 };
135 135
136 136
137 /////////////////////////////////////////////////////////////////////////////// 137 ///////////////////////////////////////////////////////////////////////////////
138 138
139 DEF_BENCH( return new TextPlaybackBench(); ) 139 DEF_BENCH( return new TextPlaybackBench(); )
140 DEF_BENCH( return new PosTextPlaybackBench(true); ) 140 DEF_BENCH( return new PosTextPlaybackBench(true); )
141 DEF_BENCH( return new PosTextPlaybackBench(false); ) 141 DEF_BENCH( return new PosTextPlaybackBench(false); )
OLDNEW
« no previous file with comments | « bench/PerlinNoiseBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698