Definition at line 109 of file TextAdapter.cpp.
◆ GlyphDecoratorNode()
skottie::internal::TextAdapter::GlyphDecoratorNode::GlyphDecoratorNode |
( |
sk_sp< GlyphDecorator > |
decorator, |
|
|
float |
scale |
|
) |
| |
|
inline |
Definition at line 111 of file TextAdapter.cpp.
112 : fDecorator(std::move(decorator))
114 {}
◆ ~GlyphDecoratorNode()
skottie::internal::TextAdapter::GlyphDecoratorNode::~GlyphDecoratorNode |
( |
| ) |
|
|
overridedefault |
◆ onRender()
void skottie::internal::TextAdapter::GlyphDecoratorNode::onRender |
( |
SkCanvas * |
canvas, |
|
|
const RenderContext * |
ctx |
|
) |
| const |
|
inlineoverridevirtual |
Implements sksg::RenderNode.
Definition at line 149 of file TextAdapter.cpp.
149 {
150 auto local_ctx = ScopedRenderContext(canvas, ctx).setIsolation(this->
bounds(),
152 true);
153 this->INHERITED::onRender(canvas, local_ctx);
154
155 fDecorator->onDecorate(canvas, {
156 SkSpan(fDecoratorInfo.get(), fFragCount),
157 fScale
158 });
159 }
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
SkMatrix getTotalMatrix() const
const SkRect & bounds() const
◆ onRevalidate()
Implements sksg::Node.
Definition at line 133 of file TextAdapter.cpp.
133 {
134 const auto child_bounds = INHERITED::onRevalidate(ic, ctm);
135
136 for (
size_t i = 0;
i < fFragCount; ++
i) {
137 const auto*
glyphs = fFragInfo[
i].fGlyphs;
138 fDecoratorInfo[
i].fBounds =
140 fDecoratorInfo[
i].fMatrix = sksg::TransformPriv::As<SkMatrix>(fFragInfo[
i].fMatrixNode);
141
142 fDecoratorInfo[
i].fCluster =
glyphs->fClusters.empty() ? 0 :
glyphs->fClusters.front();
143 fDecoratorInfo[
i].fAdvance = fFragInfo[
i].fAdvance;
144 }
145
146 return child_bounds;
147 }
◆ updateFragmentData()
void skottie::internal::TextAdapter::GlyphDecoratorNode::updateFragmentData |
( |
const std::vector< TextAdapter::FragmentRec > & |
recs | ) |
|
|
inline |
Definition at line 118 of file TextAdapter.cpp.
118 {
119 fFragCount = recs.size();
120
122 fFragInfo = std::make_unique<FragmentInfo[]>(recs.size());
123
124 for (
size_t i = 0;
i < recs.size(); ++
i) {
125 const auto& rec = recs[
i];
126 fFragInfo[
i] = {rec.fGlyphs, rec.fMatrixNode, rec.fAdvance};
127 }
128
130 fDecoratorInfo = std::make_unique<GlyphDecorator::GlyphInfo[]>(recs.size());
131 }
The documentation for this class was generated from the following file: