blob: 820902e76e1091a46a0b017ecb42697f56d4a22e [file] [log] [blame]
* Copyright 2020 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkRiveSlide_DEFINED
#define SkRiveSlide_DEFINED
#include "tools/viewer/Slide.h"
#if defined(SK_ENABLE_SKRIVE)
#include "experimental/skrive/include/SkRive.h"
class SkRiveSlide final : public Slide {
SkRiveSlide(const SkString& name, const SkString& path);
~SkRiveSlide() override;
void load(SkScalar winWidth, SkScalar winHeight) override;
void unload() override;
void resize(SkScalar, SkScalar) override;
SkISize getDimensions() const override;
void draw(SkCanvas*) override;
const SkString fPath;
sk_sp<skrive::SkRive> fRive;
SkRect fRiveBounds;
SkSize fWinSize;
using INHERITED = Slide;
#endif // defined(SK_ENABLE_SKRIVE)
#endif // SkRiveSlide_DEFINED