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

Side by Side Diff: bench/PathIterBench.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/PathBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 fPath.lineTo(pts[1]); 47 fPath.lineTo(pts[1]);
48 break; 48 break;
49 case 3: 49 case 3:
50 fPath.quadTo(pts[1], pts[2]); 50 fPath.quadTo(pts[1], pts[2]);
51 break; 51 break;
52 case 4: 52 case 4:
53 fPath.cubicTo(pts[1], pts[2], pts[3]); 53 fPath.cubicTo(pts[1], pts[2], pts[3]);
54 break; 54 break;
55 } 55 }
56 } 56 }
57 }
57 58
58 fIsRendering = false; 59 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE {
60 return backend == kNonRendering_Backend;
59 } 61 }
60 62
61 protected: 63 protected:
62 virtual const char* onGetName() SK_OVERRIDE { 64 virtual const char* onGetName() SK_OVERRIDE {
63 return fName.c_str(); 65 return fName.c_str();
64 } 66 }
65 67
66 virtual void onDraw(SkCanvas*) SK_OVERRIDE { 68 virtual void onDraw(SkCanvas*) SK_OVERRIDE {
67 if (fRaw) { 69 if (fRaw) {
68 for (int i = 0; i < this->getLoops(); ++i) { 70 for (int i = 0; i < this->getLoops(); ++i) {
(...skipping 15 matching lines...) Expand all
84 } 86 }
85 87
86 private: 88 private:
87 typedef SkBenchmark INHERITED; 89 typedef SkBenchmark INHERITED;
88 }; 90 };
89 91
90 /////////////////////////////////////////////////////////////////////////////// 92 ///////////////////////////////////////////////////////////////////////////////
91 93
92 DEF_BENCH( return new PathIterBench(false); ) 94 DEF_BENCH( return new PathIterBench(false); )
93 DEF_BENCH( return new PathIterBench(true); ) 95 DEF_BENCH( return new PathIterBench(true); )
OLDNEW
« no previous file with comments | « bench/PathBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698