aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleCode.h
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleCode.h')
-rw-r--r--samplecode/SampleCode.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h
index 02590f17a9..e65919a765 100644
--- a/samplecode/SampleCode.h
+++ b/samplecode/SampleCode.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#ifndef SampleCode_DEFINED
#define SampleCode_DEFINED
@@ -15,7 +13,9 @@
#include "SkKey.h"
#include "SkView.h"
#include "SkOSMenu.h"
+
class GrContext;
+class SkAnimTimer;
#define DEF_SAMPLE(code) \
static SkView* SK_MACRO_APPEND_LINE(F_)() { code } \
@@ -36,16 +36,6 @@ public:
static bool FastTextQ(const SkEvent&);
-private:
- static SkMSec GetAnimTime();
- static SkMSec GetAnimTimeDelta();
- static SkScalar GetAnimSecondsDelta();
- static SkScalar GetAnimScalar(SkScalar speedPerSec, SkScalar period = 0);
- // gives a sinusoidal value between 0 and amplitude
- static SkScalar GetAnimSinScalar(SkScalar amplitude,
- SkScalar periodInSec,
- SkScalar phaseInSec = 0);
-
friend class SampleWindow;
};
@@ -120,7 +110,7 @@ public:
{}
void setBGColor(SkColor color) { fBGColor = color; }
- bool animatePulse(SkMSec curr, SkMSec prev) { return this->onAnimatePulse(curr, prev); }
+ bool animate(const SkAnimTimer& timer) { return this->onAnimate(timer); }
static bool IsSampleView(SkView*);
static bool SetRepeatDraw(SkView*, int count);
@@ -140,7 +130,7 @@ public:
protected:
virtual void onDrawBackground(SkCanvas*);
virtual void onDrawContent(SkCanvas*) = 0;
- virtual bool onAnimatePulse(SkMSec curr, SkMSec prev) { return false; }
+ virtual bool onAnimate(const SkAnimTimer&) { return false; }
// overrides
virtual bool onEvent(const SkEvent& evt);