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

Unified Diff: bench/GradientBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | bench/HairlinePathBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GradientBench.cpp
diff --git a/bench/GradientBench.cpp b/bench/GradientBench.cpp
index 773522e164bb8340e6b0b8fec0014faf57f44919..8dec68bfc34e6f4c56f69b5941a657785338158f 100644
--- a/bench/GradientBench.cpp
+++ b/bench/GradientBench.cpp
@@ -159,11 +159,10 @@ static const char* geomtypename(GeomType gt) {
class GradientBench : public SkBenchmark {
SkString fName;
SkShader* fShader;
- int fCount;
+ int fRepeat;
enum {
W = 400,
H = 400,
- N = 1
};
public:
GradientBench(void* param, GradType gradType,
@@ -187,7 +186,7 @@ public:
{ SkIntToScalar(W), SkIntToScalar(H) }
};
- fCount = SkBENCHLOOP(N * gGrads[gradType].fRepeat);
+ fRepeat = gGrads[gradType].fRepeat;
fShader = gGrads[gradType].fMaker(pts, data, tm, NULL, scale);
fGeomType = geomType;
}
@@ -208,7 +207,7 @@ protected:
paint.setShader(fShader);
SkRect r = { 0, 0, SkIntToScalar(W), SkIntToScalar(H) };
- for (int i = 0; i < fCount; i++) {
+ for (int i = 0; i < this->getLoops() * fRepeat; i++) {
switch (fGeomType) {
case kRect_GeomType:
canvas->drawRect(r, paint);
@@ -251,7 +250,7 @@ protected:
{ SkIntToScalar(100), SkIntToScalar(100) },
};
- for (int i = 0; i < SkBENCHLOOP(1000); i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
const int gray = i % 256;
const int alpha = fHasAlpha ? gray : 0xFF;
SkColor colors[] = {
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | bench/HairlinePathBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698