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

Side by Side Diff: bench/PictureRecordBench.cpp

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 1 month 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 | « bench/PathIterBench.cpp ('k') | bench/RTreeBench.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 2012 Google Inc. 2 * Copyright 2012 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"
11 #include "SkPicture.h" 11 #include "SkPicture.h"
12 #include "SkPoint.h" 12 #include "SkPoint.h"
13 #include "SkRandom.h" 13 #include "SkRandom.h"
14 #include "SkRect.h" 14 #include "SkRect.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 16
17 class PictureRecordBench : public SkBenchmark { 17 class PictureRecordBench : public SkBenchmark {
18 public: 18 public:
19 PictureRecordBench(const char name[]) { 19 PictureRecordBench(const char name[]) {
20 fName.printf("picture_record_%s", name); 20 fName.printf("picture_record_%s", name);
21 fIsRendering = false; 21 }
22
23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE {
24 return backend == kNonRendering_Backend;
22 } 25 }
23 26
24 enum { 27 enum {
25 PICTURE_WIDTH = 1000, 28 PICTURE_WIDTH = 1000,
26 PICTURE_HEIGHT = 4000, 29 PICTURE_HEIGHT = 4000,
27 }; 30 };
28 protected: 31 protected:
29 virtual const char* onGetName() SK_OVERRIDE { 32 virtual const char* onGetName() SK_OVERRIDE {
30 return fName.c_str(); 33 return fName.c_str();
31 } 34 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 private: 168 private:
166 SkPaint fPaint [ObjCount]; 169 SkPaint fPaint [ObjCount];
167 typedef PictureRecordBench INHERITED; 170 typedef PictureRecordBench INHERITED;
168 }; 171 };
169 172
170 /////////////////////////////////////////////////////////////////////////////// 173 ///////////////////////////////////////////////////////////////////////////////
171 174
172 DEF_BENCH( return new DictionaryRecordBench(); ) 175 DEF_BENCH( return new DictionaryRecordBench(); )
173 DEF_BENCH( return new UniquePaintDictionaryRecordBench(); ) 176 DEF_BENCH( return new UniquePaintDictionaryRecordBench(); )
174 DEF_BENCH( return new RecurringPaintDictionaryRecordBench(); ) 177 DEF_BENCH( return new RecurringPaintDictionaryRecordBench(); )
OLDNEW
« no previous file with comments | « bench/PathIterBench.cpp ('k') | bench/RTreeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698