45cd20004c
"Artboards" are top-level Rive containers (similar to AE compositions), holding the scene graphics and related animations. Artboard properties: - name - width/height (size) - translation (position) - origin (anchor point for transforms?) - (background) color - clip contents flag Plumb artboard parsing + background rendering, and hook into viewer. TBR= Change-Id: Ib188245ce41a76197cf9e0937689adf8243826d6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295244 Reviewed-by: Florin Malita <fmalita@google.com> Commit-Queue: Florin Malita <fmalita@google.com>
42 lines
925 B
C++
42 lines
925 B
C++
/*
|
|
* 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 {
|
|
public:
|
|
SkRiveSlide(const SkString& name, const SkString& path);
|
|
~SkRiveSlide() override;
|
|
|
|
private:
|
|
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
|