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

Unified Diff: bench/PictureRecordBench.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/PicturePlaybackBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PictureRecordBench.cpp
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index 66ec19ccbdf7f9a80712475d7beba29635d2f139..4083f81af71ff5a9b648da094e3b8ac0d4fb7649 100644
--- a/bench/PictureRecordBench.cpp
+++ b/bench/PictureRecordBench.cpp
@@ -50,13 +50,13 @@ public:
DictionaryRecordBench() : INHERITED("dictionaries") {}
protected:
- virtual void onDraw(SkCanvas*) SK_OVERRIDE {
+ virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
SkAutoTDelete<SkPicture> picture;
SkCanvas* canvas = NULL;
- const SkPoint translateDelta = getTranslateDelta(this->getLoops());
+ const SkPoint translateDelta = getTranslateDelta(loops);
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
picture.reset(SkNEW(SkPicture));
canvas = picture->beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
@@ -117,12 +117,12 @@ public:
UniquePaintDictionaryRecordBench() : INHERITED("unique_paint_dictionary") { }
protected:
- virtual void onDraw(SkCanvas*) SK_OVERRIDE {
+ virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
SkRandom rand;
SkPaint paint;
SkAutoTDelete<SkPicture> picture;
SkCanvas* canvas = NULL;
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
picture.reset(SkNEW(SkPicture));
canvas = picture->beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
@@ -157,10 +157,10 @@ public:
ObjCount = 100, // number of unique paint objects
};
protected:
- virtual void onDraw(SkCanvas*) SK_OVERRIDE {
+ virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
SkPicture picture;
SkCanvas* canvas = picture.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
canvas->drawPaint(fPaint[i % ObjCount]);
}
}
« no previous file with comments | « bench/PicturePlaybackBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698