diff options
author | mtklein <mtklein@chromium.org> | 2014-06-18 07:15:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-18 07:15:49 -0700 |
commit | 683e90611c8a536c3c5feedea27bbbefedf746d2 (patch) | |
tree | 857529b367eb744630f2f7514ee7dfe03fb6f983 | |
parent | d0eecd461d665eaa771e3828e9da4b912181de8c (diff) |
Remove SkBenchmark::postDraw.
Only one bench used this feature, and it's for things that'd be done by the
destructor anyway.
BUG=skia:
R=bsalomon@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/329853007
-rw-r--r-- | bench/PathBench.cpp | 27 | ||||
-rw-r--r-- | bench/SkBenchmark.cpp | 4 | ||||
-rw-r--r-- | bench/SkBenchmark.h | 6 | ||||
-rw-r--r-- | bench/benchmain.cpp | 14 | ||||
-rw-r--r-- | dm/DMBenchTask.cpp | 2 |
5 files changed, 1 insertions, 52 deletions
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp index e11aad78f0..4b21ccf7f1 100644 --- a/bench/PathBench.cpp +++ b/bench/PathBench.cpp @@ -339,10 +339,6 @@ protected: this->restartMakingPaths(); } - virtual void onPostDraw() SK_OVERRIDE { - this->finishedMakingPaths(); - } - private: SkPath fPath; @@ -373,10 +369,6 @@ protected: fCopies[idx] = fPaths[idx]; } } - virtual void onPostDraw() SK_OVERRIDE { - fPaths.reset(0); - fCopies.reset(0); - } private: enum { @@ -424,11 +416,6 @@ protected: } } - virtual void onPostDraw() SK_OVERRIDE { - fPaths.reset(0); - fTransformed.reset(0); - } - private: enum { // must be a pow 2 @@ -470,11 +457,6 @@ protected: } } - virtual void onPostDraw() SK_OVERRIDE { - fPaths.reset(0); - fCopies.reset(0); - } - private: bool fParity; // attempt to keep compiler from optimizing out the == enum { @@ -572,11 +554,6 @@ protected: } } - virtual void onPostDraw() SK_OVERRIDE { - fPaths0.reset(0); - fPaths1.reset(0); - } - private: AddType fType; // or reverseAddPath enum { @@ -808,10 +785,6 @@ private: } } - virtual void onPostDraw() SK_OVERRIDE { - fQueryRects.setCount(0); - } - enum { kQueryRectCnt = 400, }; diff --git a/bench/SkBenchmark.cpp b/bench/SkBenchmark.cpp index 1f12ed339f..d1f0639e06 100644 --- a/bench/SkBenchmark.cpp +++ b/bench/SkBenchmark.cpp @@ -38,10 +38,6 @@ void SkBenchmark::draw(const int loops, SkCanvas* canvas) { this->onDraw(loops, canvas); } -void SkBenchmark::postDraw() { - this->onPostDraw(); -} - void SkBenchmark::setupPaint(SkPaint* paint) { paint->setAlpha(fForceAlpha); paint->setAntiAlias(fForceAA); diff --git a/bench/SkBenchmark.h b/bench/SkBenchmark.h index 00a816cdba..e86c81b8ec 100644 --- a/bench/SkBenchmark.h +++ b/bench/SkBenchmark.h @@ -72,11 +72,6 @@ public: // Bench framework can tune loops to be large enough for stable timing. void draw(const int loops, SkCanvas*); - // Call after draw, allows the benchmark to do cleanup work outside of the - // timer. When a benchmark is repeatedly drawn, this is only called once - // after the last draw. - void postDraw(); - void setForceAlpha(int alpha) { fForceAlpha = alpha; } @@ -118,7 +113,6 @@ protected: // Each bench should do its main work in a loop like this: // for (int i = 0; i < loops; i++) { <work here> } virtual void onDraw(const int loops, SkCanvas*) = 0; - virtual void onPostDraw() {} virtual SkIPoint onGetSize(); diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp index 42428b44b0..af70878282 100644 --- a/bench/benchmain.cpp +++ b/bench/benchmain.cpp @@ -78,18 +78,6 @@ private: const skiagm::GMRegistry* fGMs; }; -class AutoPrePostDraw { -public: - AutoPrePostDraw(SkBenchmark* bench) : fBench(bench) { - fBench->preDraw(); - } - ~AutoPrePostDraw() { - fBench->postDraw(); - } -private: - SkBenchmark* fBench; -}; - static void make_filename(const char name[], SkString* path) { path->set(name); for (int i = 0; name[i]; i++) { @@ -462,7 +450,7 @@ int tool_main(int argc, char** argv) { bench->setForceAA(FLAGS_forceAA); bench->setForceFilter(FLAGS_forceFilter); bench->setDither(dither); - AutoPrePostDraw appd(bench); + bench->preDraw(); bool loggedBenchName = false; for (int i = 0; i < configs.count(); ++i) { diff --git a/dm/DMBenchTask.cpp b/dm/DMBenchTask.cpp index 917e861274..619bbc1b14 100644 --- a/dm/DMBenchTask.cpp +++ b/dm/DMBenchTask.cpp @@ -59,7 +59,6 @@ static void draw_raster(SkBenchmark* bench, SkColorType colorType) { bench->preDraw(); bench->draw(1, &canvas); - bench->postDraw(); } void NonRenderingBenchTask::draw() { @@ -79,7 +78,6 @@ void GpuBenchTask::draw(GrContextFactory* grFactory) { fBench->preDraw(); fBench->draw(1, surface->getCanvas()); - fBench->postDraw(); } } // namespace DM |