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

Unified Diff: bench/DeferredCanvasBench.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/DecodeBench.cpp ('k') | bench/DeferredSurfaceCopyBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/DeferredCanvasBench.cpp
diff --git a/bench/DeferredCanvasBench.cpp b/bench/DeferredCanvasBench.cpp
index d2fb9f22ae81f79b5214a7b05c131321230cc9ed..6bf4dfdc3b866f323baadf0dcb1a235a0a2bdd3b 100644
--- a/bench/DeferredCanvasBench.cpp
+++ b/bench/DeferredCanvasBench.cpp
@@ -24,7 +24,7 @@ protected:
return fName.c_str();
}
- virtual void onDraw(SkCanvas* canvas) {
+ virtual void onDraw(const int loops, SkCanvas* canvas) {
SkBaseDevice *device = canvas->getDevice()->createCompatibleDevice(
SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false);
@@ -32,13 +32,13 @@ protected:
device->unref();
initDeferredCanvas(deferredCanvas);
- drawInDeferredCanvas(deferredCanvas);
+ drawInDeferredCanvas(loops, deferredCanvas);
finalizeDeferredCanvas(deferredCanvas);
deferredCanvas->flush();
}
virtual void initDeferredCanvas(SkDeferredCanvas* canvas) = 0;
- virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) = 0;
+ virtual void drawInDeferredCanvas(const int loops, SkDeferredCanvas* canvas) = 0;
virtual void finalizeDeferredCanvas(SkDeferredCanvas* canvas) = 0;
SkString fName;
@@ -76,11 +76,11 @@ protected:
canvas->setNotificationClient(&fNotificationClient);
}
- virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) SK_OVERRIDE {
+ virtual void drawInDeferredCanvas(const int loops, SkDeferredCanvas* canvas) SK_OVERRIDE {
SkRect rect;
rect.setXYWH(0, 0, 10, 10);
SkPaint paint;
- for (int i = 0; i < this->getLoops(); i++) {
+ for (int i = 0; i < loops; i++) {
canvas->save(SkCanvas::kMatrixClip_SaveFlag);
canvas->translate(SkIntToScalar(i * 27 % CANVAS_WIDTH), SkIntToScalar(i * 13 % CANVAS_HEIGHT));
canvas->drawRect(rect, paint);
« no previous file with comments | « bench/DecodeBench.cpp ('k') | bench/DeferredSurfaceCopyBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698