diff options
author | jvanverth <jvanverth@google.com> | 2016-06-13 09:31:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-13 09:31:27 -0700 |
commit | 76963e73704a42a18c29d6fbdcccb566e5c67658 (patch) | |
tree | e007527879859f5c1857bd9bf3c2c3df32a1fd4c /tools/viewer/SampleSlide.h | |
parent | fe19987e5499650e8637a8d109f19b8156601660 (diff) |
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
Review-Url: https://codereview.chromium.org/2056343004
Diffstat (limited to 'tools/viewer/SampleSlide.h')
-rwxr-xr-x | tools/viewer/SampleSlide.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/viewer/SampleSlide.h b/tools/viewer/SampleSlide.h new file mode 100755 index 0000000000..3d772d093d --- /dev/null +++ b/tools/viewer/SampleSlide.h @@ -0,0 +1,34 @@ +/* +* 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 SampleSlide_DEFINED +#define SampleSlide_DEFINED + +#include "Slide.h" +#include "SampleCode.h" + +class SampleSlide : public Slide { +public: + SampleSlide(const SkViewFactory* factory); + ~SampleSlide() override; + + void draw(SkCanvas* canvas) override; + void load(SkScalar winWidth, SkScalar winHeight) override; + void unload() override; + bool animate(const SkAnimTimer& timer) override { + if (SampleView::IsSampleView(fView)) { + return ((SampleView*)fView)->animate(timer); + } + return false; + } + +private: + const SkViewFactory* fViewFactory; + SkView* fView; +}; + +#endif |