2016-06-16 16:52:35 +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 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 {
|
2017-02-24 20:22:53 +00:00
|
|
|
if (fView && SampleView::IsSampleView(fView.get())) {
|
|
|
|
return ((SampleView*)fView.get())->animate(timer);
|
2016-06-16 16:52:35 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-02-14 20:16:46 +00:00
|
|
|
bool onChar(SkUnichar c) override;
|
2017-11-02 13:46:49 +00:00
|
|
|
bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
|
|
|
|
uint32_t modifiers) override;
|
2017-02-14 20:16:46 +00:00
|
|
|
|
2016-06-16 16:52:35 +00:00
|
|
|
private:
|
|
|
|
const SkViewFactory* fViewFactory;
|
2017-02-24 20:22:53 +00:00
|
|
|
sk_sp<SkView> fView;
|
2017-11-02 13:46:49 +00:00
|
|
|
SkView::Click* fClick;
|
2016-06-16 16:52:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|