• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 
8 #ifndef NIMASlide_DEFINED
9 #define NIMASlide_DEFINED
10 
11 #include "Slide.h"
12 
13 #include "SkCanvas.h"
14 #include "SkVertices.h"
15 #include "nima/NimaActor.h"
16 
17 class NIMASlide : public Slide {
18 public:
19     NIMASlide(const SkString& name, const SkString& path);
20     ~NIMASlide() override;
21 
22     SkISize getDimensions() const override;
23 
24     void draw(SkCanvas* canvas) override;
25     void load(SkScalar winWidth, SkScalar winHeight) override;
26     void unload() override;
27     bool animate(const SkAnimTimer& timer) override;
28 
29     bool onChar(SkUnichar c) override;
30     bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
31                  uint32_t modifiers) override;
32 
33 private:
34     void resetActor();
35 
36     void renderGUI();
37 
38 private:
39     std::string                fBasePath;
40     std::unique_ptr<NimaActor> fActor;
41     int                        fAnimationIndex;
42 
43     bool fPlaying;
44     float fTime;
45     uint32_t fRenderFlags;
46 };
47 
48 #endif
49