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

Unified Diff: bench/RectBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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 | « bench/ReadPixBench.cpp ('k') | bench/RectoriBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RectBench.cpp
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index 200fb0d330877abc8e9fa10234ce6a94255d4f87..ee0f76b8129fab995a8b904023c15420243c4df4 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -62,13 +62,13 @@ protected:
}
virtual const char* onGetName() { return computeName("rects"); }
- virtual void onDraw(SkCanvas* canvas) {
+ virtual void onDraw(const int loops, SkCanvas* canvas) {
SkPaint paint;
if (fStroke > 0) {
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(fStroke));
}
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
paint.setColor(fColors[i % N]);
this->setupPaint(&paint);
this->drawThisRect(canvas, fRects[i % N], paint);
@@ -141,7 +141,7 @@ public:
}
protected:
- virtual void onDraw(SkCanvas* canvas) {
+ virtual void onDraw(const int loops, SkCanvas* canvas) {
SkScalar gSizes[] = {
SkIntToScalar(7), 0
};
@@ -155,7 +155,7 @@ protected:
SkPaint paint;
paint.setStrokeCap(SkPaint::kRound_Cap);
- for (int loop = 0; loop < this->getLoops(); loop++) {
+ for (int loop = 0; loop < loops; loop++) {
for (size_t i = 0; i < sizes; i++) {
paint.setStrokeWidth(gSizes[i]);
this->setupPaint(&paint);
@@ -185,7 +185,7 @@ protected:
return "aarects";
}
- virtual void onDraw(SkCanvas* canvas) {
+ virtual void onDraw(const int loops, SkCanvas* canvas) {
static const SkScalar kHalfRectSize = 0.75f;
SkPaint paint;
@@ -195,7 +195,7 @@ protected:
SkRect r = { -kHalfRectSize, -kHalfRectSize, kHalfRectSize, kHalfRectSize };
int rot = 0;
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
// Draw small aa rects in a grid across the screen
for (SkScalar y = kHalfRectSize+SK_Scalar1; y < H; y += 2*kHalfRectSize+2) {
for (SkScalar x = kHalfRectSize+SK_Scalar1; x < W; x += 2*kHalfRectSize+2) {
@@ -243,7 +243,7 @@ public:
}
protected:
- virtual void onDraw(SkCanvas* canvas) {
+ virtual void onDraw(const int loops, SkCanvas* canvas) {
SkScalar gSizes[] = {
SkIntToScalar(13), SkIntToScalar(24)
};
@@ -269,7 +269,7 @@ protected:
SkShader::kClamp_TileMode);
paint.setShader(s)->unref();
}
- for (int loop = 0; loop < this->getLoops(); loop++) {
+ for (int loop = 0; loop < loops; loop++) {
for (size_t i = 0; i < sizes; i++) {
switch (_type) {
case kMaskOpaque:
« no previous file with comments | « bench/ReadPixBench.cpp ('k') | bench/RectoriBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698