2016-04-08 14:24:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Slide_DEFINED
|
|
|
|
#define Slide_DEFINED
|
|
|
|
|
|
|
|
#include "SkRefCnt.h"
|
2016-04-21 14:59:44 +00:00
|
|
|
#include "SkSize.h"
|
2016-04-08 14:24:09 +00:00
|
|
|
#include "SkString.h"
|
|
|
|
|
|
|
|
class SkCanvas;
|
2016-04-08 19:51:45 +00:00
|
|
|
class SkAnimTimer;
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
class Slide : public SkRefCnt {
|
|
|
|
public:
|
|
|
|
virtual ~Slide() {}
|
|
|
|
|
2016-06-16 16:52:35 +00:00
|
|
|
virtual SkISize getDimensions() const {
|
|
|
|
return SkISize::Make(0, 0);
|
|
|
|
}
|
2016-04-21 14:59:44 +00:00
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
virtual void draw(SkCanvas* canvas) = 0;
|
2016-04-08 19:51:45 +00:00
|
|
|
virtual bool animate(const SkAnimTimer&) { return false; }
|
2016-06-16 16:52:35 +00:00
|
|
|
virtual void load(SkScalar winWidth, SkScalar winHeight) {}
|
2016-04-08 19:51:45 +00:00
|
|
|
virtual void unload() {}
|
|
|
|
|
2017-02-14 20:16:46 +00:00
|
|
|
virtual bool onChar(SkUnichar c) { return false; }
|
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
SkString getName() { return fName; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
SkString fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|