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

Unified Diff: samplecode/SampleCode.h

Issue 888283002: allow GMs to animate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: switch all existing animations to use animatePulse Created 5 years, 11 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 | « samplecode/SampleCamera.cpp ('k') | samplecode/SampleDegenerateTwoPtRadials.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleCode.h
diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h
index d09022f35064c877eb3d4ee4fe6d1b95343e037c..02590f17a90d1a9e4b985e298131604c799935c4 100644
--- a/samplecode/SampleCode.h
+++ b/samplecode/SampleCode.h
@@ -36,6 +36,7 @@ public:
static bool FastTextQ(const SkEvent&);
+private:
static SkMSec GetAnimTime();
static SkMSec GetAnimTimeDelta();
static SkScalar GetAnimSecondsDelta();
@@ -44,6 +45,8 @@ public:
static SkScalar GetAnimSinScalar(SkScalar amplitude,
SkScalar periodInSec,
SkScalar phaseInSec = 0);
+
+ friend class SampleWindow;
};
//////////////////////////////////////////////////////////////////////////////
@@ -117,6 +120,7 @@ public:
{}
void setBGColor(SkColor color) { fBGColor = color; }
+ bool animatePulse(SkMSec curr, SkMSec prev) { return this->onAnimatePulse(curr, prev); }
static bool IsSampleView(SkView*);
static bool SetRepeatDraw(SkView*, int count);
@@ -136,6 +140,7 @@ public:
protected:
virtual void onDrawBackground(SkCanvas*);
virtual void onDrawContent(SkCanvas*) = 0;
+ virtual bool onAnimatePulse(SkMSec curr, SkMSec prev) { return false; }
// overrides
virtual bool onEvent(const SkEvent& evt);
« no previous file with comments | « samplecode/SampleCamera.cpp ('k') | samplecode/SampleDegenerateTwoPtRadials.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698