fa7e9a813e
- pull latest RapidJSON under third_party/externals/rapidjson (note: and older RS version is already pulled as part of angle2, and it is also checked in G3) - add a thin Json porting layer (SkottieJson) to isolate RS idiosyncrasies - convert Skottie to use the new helpers - parse the DOM in-place (based on local experiments this is the fastest method) Ta-da: Skottie now parses JSON ~10x faster! Change-Id: Ida9099638f88ed025fee83055c8cd8680ee27176 Reviewed-on: https://skia-review.googlesource.com/125744 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
30 lines
747 B
C++
30 lines
747 B
C++
/*
|
|
* Copyright 2017 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkottieAnimator_DEFINED
|
|
#define SkottieAnimator_DEFINED
|
|
|
|
#include "SkSGScene.h"
|
|
|
|
#include <functional>
|
|
|
|
namespace skottie {
|
|
|
|
namespace json { class ValueRef; }
|
|
|
|
// This is the workhorse for property binding: depending on whether the property is animated,
|
|
// it will either apply immediately or instantiate and attach a keyframe animator.
|
|
template <typename T>
|
|
bool BindProperty(const json::ValueRef&,
|
|
sksg::AnimatorList*,
|
|
std::function<void(const T&)>&&,
|
|
const T* noop = nullptr);
|
|
|
|
} // namespace skottie
|
|
|
|
#endif // SkottieAnimator_DEFINED
|