/* * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkottieUtils_DEFINED #define SkottieUtils_DEFINED #include "Skottie.h" #include "SkString.h" #include class SkAnimCodecPlayer; class SkData; class SkImage; namespace skottie_utils { class MultiFrameImageAsset final : public skottie::ImageAsset { public: static sk_sp Make(sk_sp); bool isMultiFrame() override; sk_sp getFrame(float t) override; private: explicit MultiFrameImageAsset(std::unique_ptr); std::unique_ptr fPlayer; using INHERITED = skottie::ImageAsset; }; class FileResourceProvider final : public skottie::ResourceProvider { public: static sk_sp Make(SkString base_dir); sk_sp load(const char resource_path[], const char resource_name[]) const override; sk_sp loadImageAsset(const char[], const char []) const override; private: explicit FileResourceProvider(SkString); const SkString fDir; using INHERITED = skottie::ResourceProvider; }; } // namespace skottie_utils #endif // SkottieUtils_DEFINED