chromium/third_party/skia/modules/skottie/src/animator/ShapeKeyframeAnimator.cpp

/*
 * Copyright 2020 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "include/core/SkPath.h"
#include "include/core/SkPathBuilder.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkTo.h"
#include "modules/skottie/src/SkottieJson.h"
#include "modules/skottie/src/SkottieValue.h"
#include "modules/skottie/src/animator/Animator.h"
#include "modules/skottie/src/animator/VectorKeyframeAnimator.h"
#include "src/utils/SkJSON.h"

#include <cstddef>
#include <vector>

namespace skottie::internal {
class AnimationBuilder;
}

namespace skottie {

// Shapes (paths) are encoded as a vector of floats.  For each vertex, we store 6 floats:
//
//   - vertex point      (2 floats)
//   - in-tangent point  (2 floats)
//   - out-tangent point (2 floats)
//
// Additionally, we store one trailing "closed shape" flag - e.g.
//
//  [ v0.x, v0.y, v0_in.x, v0_in.y, v0_out.x, v0_out.y, ... , closed_flag ]
//
enum ShapeEncodingInfo : size_t {};

static size_t shape_encoding_len(size_t vertex_count) {}

// Some versions wrap shape values as single-element arrays.
static const skjson::ObjectValue* shape_root(const skjson::Value& jv) {}

static bool parse_encoding_len(const skjson::Value& jv, size_t* len) {}

static bool parse_encoding_data(const skjson::Value& jv, size_t data_len, float data[]) {}

operator SkPath()

namespace internal {

template <>
bool AnimatablePropertyContainer::bind<ShapeValue>(const AnimationBuilder& abuilder,
                                                  const skjson::ObjectValue* jprop,
                                                  ShapeValue* v) {}

} // namespace internal

} // namespace skottie