skia2/tools/viewer/Slide.h
jvanverth c7027ab03f Add samples to Viewer.
This adds support with animation, assuming the sample has
implemented onAnimate. Event handling has not been
implemented.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2056343004

Committed: https://skia.googlesource.com/skia/+/76963e73704a42a18c29d6fbdcccb566e5c67658
Review-Url: https://codereview.chromium.org/2056343004
2016-06-16 09:52:35 -07:00

39 lines
729 B
C++

/*
* 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"
#include "SkSize.h"
#include "SkString.h"
class SkCanvas;
class SkAnimTimer;
class Slide : public SkRefCnt {
public:
virtual ~Slide() {}
virtual SkISize getDimensions() const {
return SkISize::Make(0, 0);
}
virtual void draw(SkCanvas* canvas) = 0;
virtual bool animate(const SkAnimTimer&) { return false; }
virtual void load(SkScalar winWidth, SkScalar winHeight) {}
virtual void unload() {}
SkString getName() { return fName; }
protected:
SkString fName;
};
#endif