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

Unified Diff: bench/SKPAnimationBench.h

Issue 1211253003: Make nanobench zoom animation time based (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_printvalueswithverbose
Patch Set: fix msvc Created 5 years, 6 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 | « no previous file | bench/SKPAnimationBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SKPAnimationBench.h
diff --git a/bench/SKPAnimationBench.h b/bench/SKPAnimationBench.h
index 65708f763943c2dcb83fb2acb2289912be3f21fa..c0bef308ec2e74c452580d3f7f22423f18016282 100644
--- a/bench/SKPAnimationBench.h
+++ b/bench/SKPAnimationBench.h
@@ -9,6 +9,7 @@
#define SKPAnimationBench_DEFINED
#include "SKPBench.h"
+#include "Timer.h"
/**
* Runs an SkPicture as a benchmark by repeatedly drawing it, first centering the picture and
@@ -16,11 +17,20 @@
*/
class SKPAnimationBench : public SKPBench {
public:
- SKPAnimationBench(const char* name, const SkPicture*, const SkIRect& devClip,
- SkMatrix viewMatrix, int steps, bool doLooping);
+ class Animation : public SkRefCnt {
+ public:
+ virtual const char* getTag() = 0;
+ virtual void preConcatFrameMatrix(double animationTimeMs, const SkIRect& devBounds,
+ SkMatrix* drawMatrix) = 0;
+ virtual ~Animation() {}
+ };
+
+ SKPAnimationBench(const char* name, const SkPicture*, const SkIRect& devClip, Animation*,
+ bool doLooping);
+
+ static Animation* CreateZoomAnimation(SkScalar zoomMax, double zoomPeriodMs);
protected:
- const char* onGetName() override;
const char* onGetUniqueName() override;
void onPerCanvasPreDraw(SkCanvas* canvas) override;
@@ -30,11 +40,10 @@ protected:
void drawPicture() override;
private:
- int fSteps;
- SkMatrix fAnimationMatrix;
- SkString fName;
- SkString fUniqueName;
- SkPoint fCenter;
+ SkAutoTUnref<Animation> fAnimation;
+ WallTimer fAnimationTimer;
+ SkString fUniqueName;
+ SkIRect fDevBounds;
typedef SKPBench INHERITED;
};
« no previous file with comments | « no previous file | bench/SKPAnimationBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698