#include "modules/skottie/src/text/TextAdapter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkContourMeasure.h"
#include "include/core/SkFont.h"
#include "include/core/SkFontMgr.h"
#include "include/core/SkM44.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSpan.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTo.h"
#include "include/utils/SkTextUtils.h"
#include "modules/skottie/include/Skottie.h"
#include "modules/skottie/include/SkottieProperty.h"
#include "modules/skottie/src/SkottieJson.h"
#include "modules/skottie/src/SkottiePriv.h"
#include "modules/skottie/src/text/RangeSelector.h"
#include "modules/skottie/src/text/TextAnimator.h"
#include "modules/sksg/include/SkSGDraw.h"
#include "modules/sksg/include/SkSGGeometryNode.h"
#include "modules/sksg/include/SkSGGroup.h"
#include "modules/sksg/include/SkSGPaint.h"
#include "modules/sksg/include/SkSGPath.h"
#include "modules/sksg/include/SkSGRect.h"
#include "modules/sksg/include/SkSGRenderEffect.h"
#include "modules/sksg/include/SkSGRenderNode.h"
#include "modules/sksg/include/SkSGTransform.h"
#include "modules/sksg/src/SkSGTransformPriv.h"
#include "modules/skshaper/include/SkShaper_factory.h"
#include "src/utils/SkJSON.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <tuple>
#include <utility>
namespace sksg {
class InvalidationController;
}
#define SHOW_LAYOUT_BOXES …
namespace skottie::internal {
namespace {
class GlyphTextNode final : public sksg::GeometryNode { … };
static float align_factor(SkTextUtils::Align a) { … }
}
class TextAdapter::GlyphDecoratorNode final : public sksg::Group { … };
struct TextAdapter::PathInfo { … };
sk_sp<TextAdapter> TextAdapter::Make(const skjson::ObjectValue& jlayer,
const AnimationBuilder* abuilder,
sk_sp<SkFontMgr> fontmgr,
sk_sp<CustomFont::GlyphCompMapper> custom_glyph_mapper,
sk_sp<Logger> logger,
sk_sp<::SkShapers::Factory> factory) { … }
TextAdapter::TextAdapter(sk_sp<SkFontMgr> fontmgr,
sk_sp<CustomFont::GlyphCompMapper> custom_glyph_mapper,
sk_sp<Logger> logger,
sk_sp<SkShapers::Factory> factory,
AnchorPointGrouping apg)
: … { … }
TextAdapter::~TextAdapter() = default;
std::vector<sk_sp<sksg::RenderNode>>
TextAdapter::buildGlyphCompNodes(Shaper::ShapedGlyphs& glyphs) const { … }
void TextAdapter::addFragment(Shaper::Fragment& frag, sksg::Group* container) { … }
void TextAdapter::buildDomainMaps(const Shaper::Result& shape_result) { … }
void TextAdapter::setText(const TextValue& txt) { … }
uint32_t TextAdapter::shaperFlags() const { … }
void TextAdapter::reshape() { … }
void TextAdapter::onSync() { … }
SkV2 TextAdapter::fragmentAnchorPoint(const FragmentRec& rec,
const SkV2& grouping_alignment,
const TextAnimator::DomainSpan* grouping_span) const { … }
SkM44 TextAdapter::fragmentMatrix(const TextAnimator::ResolvedProps& props,
const FragmentRec& rec, const SkV2& frag_offset) const { … }
void TextAdapter::pushPropsToFragment(const TextAnimator::ResolvedProps& props,
const FragmentRec& rec,
const SkV2& frag_offset,
const SkV2& grouping_alignment,
const TextAnimator::DomainSpan* grouping_span) const { … }
}