1 /*
2 * Copyright 2016 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 SampleSlide_DEFINED
9 #define SampleSlide_DEFINED
10 
11 #include "Slide.h"
12 #include "Sample.h"
13 
14 class SampleSlide : public Slide {
15 public:
16     SampleSlide(const SampleFactory factory);
17     ~SampleSlide() override;
18 
19     SkISize getDimensions() const override;
20 
21     void draw(SkCanvas* canvas) override;
22     void load(SkScalar winWidth, SkScalar winHeight) override;
resize(SkScalar winWidth,SkScalar winHeight)23     void resize(SkScalar winWidth, SkScalar winHeight) override {
24         fSample->setSize(winWidth, winHeight);
25     }
26     void unload() override;
animate(const SkAnimTimer & timer)27     bool animate(const SkAnimTimer& timer) override {
28         return fSample->animate(timer);
29     }
30 
31     bool onChar(SkUnichar c) override;
32     bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
33                  uint32_t modifiers) override;
34 
35 private:
36     const SampleFactory fSampleFactory;
37     sk_sp<Sample> fSample;
38     Sample::Click* fClick;
39 };
40 
41 #endif
42