skia2/samplecode/SampleCode.h
reed@android.com 4417740a48 add SampleCode::GetAnimTime() so slides go through a central location for
animation timing. This allows us to "freeze" time in order to do things like
draw multiple times to test clipping.



git-svn-id: http://skia.googlecode.com/svn/trunk@444 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-23 21:07:51 +00:00

42 lines
953 B
C++

#ifndef SampleCode_DEFINED
#define SampleCode_DEFINED
#include "SkEvent.h"
class SampleCode {
public:
static bool TitleQ(const SkEvent&);
static void TitleR(SkEvent*, const char title[]);
static bool PrefSizeQ(const SkEvent&);
static void PrefSizeR(SkEvent*, SkScalar width, SkScalar height);
static SkMSec GetAnimTime();
static SkScalar GetAnimScalar(SkScalar speedPerSec, SkScalar period = 0);
};
//////////////////////////////////////////////////////////////////////////////
class SkView;
typedef SkView* (*SkViewFactory)();
class SkViewRegister : SkNoncopyable {
public:
explicit SkViewRegister(SkViewFactory);
static const SkViewRegister* Head() { return gHead; }
SkViewRegister* next() const { return fChain; }
SkViewFactory factory() const { return fFact; }
private:
SkViewFactory fFact;
SkViewRegister* fChain;
static SkViewRegister* gHead;
};
#endif