Lines Matching refs:ctx
41 static bool _draw(LottieGroup* parent, LottieShape* shape, RenderContext* ctx);
176 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateTransform() argument
184 if (!ctx->transform) ctx->transform = (Matrix*)malloc(sizeof(Matrix)); in updateTransform()
185 _updateTransform(transform, frameNo, false, *ctx->transform, opacity, exps); in updateTransform()
189 ctx->merging = nullptr; in updateTransform()
194 ctx->propagator->transform(PP(ctx->propagator)->transform() * matrix); in updateTransform()
195 ctx->propagator->opacity(MULTIPLY(opacity, PP(ctx->propagator)->opacity)); in updateTransform()
198 if (P(ctx->propagator)->rs.strokeWidth() > 0.0f) { in updateTransform()
200 … if (denominator > 1.0f) ctx->propagator->stroke(ctx->propagator->strokeWidth() / denominator); in updateTransform()
205 …ttieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& pcontexts, RenderContext* ctx) in updateGroup() argument
213 group->reqFragment |= ctx->reqFragment; in updateGroup()
216 if (group->mergeable()) _draw(parent, nullptr, ctx); in updateGroup()
219 …auto propagator = group->mergeable() ? ctx->propagator : static_cast<Shape*>(PP(ctx->propagator)->… in updateGroup()
220 contexts.back(new RenderContext(*ctx, propagator, group->mergeable())); in updateGroup()
228 static void _updateStroke(LottieStroke* stroke, float frameNo, RenderContext* ctx, LottieExpression… in _updateStroke() argument
230 ctx->propagator->stroke(stroke->width(frameNo, exps)); in _updateStroke()
231 ctx->propagator->stroke(stroke->cap); in _updateStroke()
232 ctx->propagator->stroke(stroke->join); in _updateStroke()
233 ctx->propagator->strokeMiterlimit(stroke->miterLimit); in _updateStroke()
239 P(ctx->propagator)->strokeDash(dashes, 2, stroke->dashOffset(frameNo, exps)); in _updateStroke()
241 ctx->propagator->stroke(nullptr, 0); in _updateStroke()
246 …ted(LottieGroup* parent, LottieObject** child, Inlist<RenderContext>& contexts, RenderContext* ctx) in _fragmented() argument
248 if (!ctx->reqFragment) return false; in _fragmented()
249 if (ctx->fragmenting) return true; in _fragmented()
251 …contexts.back(new RenderContext(*ctx, static_cast<Shape*>(PP(ctx->propagator)->duplicate(parent->p… in _fragmented()
254 ctx->fragmenting = true; in _fragmented()
260 …* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx) in updateSolidStroke() argument
262 if (_fragmented(parent, child, contexts, ctx)) return; in updateSolidStroke()
266 ctx->merging = nullptr; in updateSolidStroke()
268 … ctx->propagator->stroke(color.rgb[0], color.rgb[1], color.rgb[2], stroke->opacity(frameNo, exps)); in updateSolidStroke()
269 _updateStroke(static_cast<LottieStroke*>(stroke), frameNo, ctx, exps); in updateSolidStroke()
273 …* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx) in updateGradientStroke() argument
275 if (_fragmented(parent, child, contexts, ctx)) return; in updateGradientStroke()
279 ctx->merging = nullptr; in updateGradientStroke()
280 ctx->propagator->stroke(unique_ptr<Fill>(stroke->fill(frameNo, exps))); in updateGradientStroke()
281 _updateStroke(static_cast<LottieStroke*>(stroke), frameNo, ctx, exps); in updateGradientStroke()
285 …* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx) in updateSolidFill() argument
287 if (_fragmented(parent, child, contexts, ctx)) return; in updateSolidFill()
291 ctx->merging = nullptr; in updateSolidFill()
293 ctx->propagator->fill(color.rgb[0], color.rgb[1], color.rgb[2], fill->opacity(frameNo, exps)); in updateSolidFill()
294 ctx->propagator->fill(fill->rule); in updateSolidFill()
296 if (ctx->propagator->strokeWidth() > 0) ctx->propagator->order(true); in updateSolidFill()
300 …* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx) in updateGradientFill() argument
302 if (_fragmented(parent, child, contexts, ctx)) return; in updateGradientFill()
306 ctx->merging = nullptr; in updateGradientFill()
308 ctx->propagator->fill(unique_ptr<Fill>(fill->fill(frameNo, exps))); in updateGradientFill()
309 ctx->propagator->fill(fill->rule); in updateGradientFill()
311 if (ctx->propagator->strokeWidth() > 0) ctx->propagator->order(true); in updateGradientFill()
315 static bool _draw(LottieGroup* parent, LottieShape* shape, RenderContext* ctx) in _draw() argument
317 if (ctx->merging) return false; in _draw()
320 ctx->merging = shape->pooling(); in _draw()
321 PP(ctx->propagator)->duplicate(ctx->merging); in _draw()
323 ctx->merging = static_cast<Shape*>(ctx->propagator->duplicate()); in _draw()
326 parent->scene->push(cast(ctx->merging)); in _draw()
332 static void _repeat(LottieGroup* parent, Shape* path, RenderContext* ctx) in _repeat() argument
335 propagators.push(ctx->propagator); in _repeat()
338 for (auto repeater = ctx->repeaters.end() - 1; repeater >= ctx->repeaters.begin(); --repeater) { in _repeat()
472 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateRect() argument
480 if (ctx->roundness) ctx->roundness->modifyRect(size, r); in updateRect()
485 if (!ctx->repeaters.empty()) { in updateRect()
488 …x - size.x * 0.5f, position.y - size.y * 0.5f, size.x, size.y, r, ctx->offsetPath, ctx->transform,… in updateRect()
489 _repeat(parent, shape, ctx); in updateRect()
491 _draw(parent, rect, ctx); in updateRect()
492 …_appendRect(ctx->merging, position.x - size.x * 0.5f, position.y - size.y * 0.5f, size.x, size.y, … in updateRect()
539 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateEllipse() argument
546 if (!ctx->repeaters.empty()) { in updateEllipse()
549 …rcle(shape, position.x, position.y, size.x * 0.5f, size.y * 0.5f, ctx->offsetPath, ctx->transform,… in updateEllipse()
550 _repeat(parent, shape, ctx); in updateEllipse()
552 _draw(parent, ellipse, ctx); in updateEllipse()
553 …_appendCircle(ctx->merging, position.x, position.y, size.x * 0.5f, size.y * 0.5f, ctx->offsetPath,… in updateEllipse()
558 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updatePath() argument
562 if (!ctx->repeaters.empty()) { in updatePath()
565 …et(frameNo, P(shape)->rs.path.cmds, P(shape)->rs.path.pts, ctx->transform, ctx->roundness, ctx->of… in updatePath()
566 _repeat(parent, shape, ctx); in updatePath()
568 _draw(parent, path, ctx); in updatePath()
569 …if (path->pathset(frameNo, P(ctx->merging)->rs.path.cmds, P(ctx->merging)->rs.path.pts, ctx->trans… in updatePath()
570 P(ctx->merging)->update(RenderUpdateFlag::Path); in updatePath()
790 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updatePolystar() argument
801 if (ctx->transform) matrix = *ctx->transform * matrix; in updatePolystar()
805 if (!ctx->repeaters.empty()) { in updatePolystar()
808 …tar::Star) _updateStar(parent, star, identity ? nullptr : &matrix, ctx->roundness, ctx->offsetPath… in updatePolystar()
809 …else _updatePolygon(parent, star, identity ? nullptr : &matrix, ctx->roundness, ctx->offsetPath, … in updatePolystar()
810 _repeat(parent, shape, ctx); in updatePolystar()
812 _draw(parent, star, ctx); in updatePolystar()
813 …pdateStar(parent, star, identity ? nullptr : &matrix, ctx->roundness, ctx->offsetPath, frameNo, ct… in updatePolystar()
814 …ePolygon(parent, star, identity ? nullptr : &matrix, ctx->roundness, ctx->offsetPath, frameNo, ct… in updatePolystar()
815 P(ctx->merging)->update(RenderUpdateFlag::Path); in updatePolystar()
820 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateRoundedCorner() argument
826 if (!ctx->roundness) ctx->roundness = new LottieRoundnessModifier(r); in updateRoundedCorner()
827 else if (ctx->roundness->r < r) ctx->roundness->r = r; in updateRoundedCorner()
831 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateOffsetPath() argument
834 …if (!ctx->offsetPath) ctx->offsetPath = new LottieOffsetModifier(offsetPath->offset(frameNo, exps)… in updateOffsetPath()
838 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateRepeater() argument
844 r.transform = PP(ctx->propagator)->transform(); in updateRepeater()
854 ctx->repeaters.push(r); in updateRepeater()
856 ctx->merging = nullptr; in updateRepeater()
860 …ottieObject** child, float frameNo, TVG_UNUSED Inlist<RenderContext>& contexts, RenderContext* ctx) in updateTrimpath() argument
867 if (P(ctx->propagator)->rs.stroke) { in updateTrimpath()
868 auto pbegin = P(ctx->propagator)->rs.stroke->trim.begin; in updateTrimpath()
869 auto pend = P(ctx->propagator)->rs.stroke->trim.end; in updateTrimpath()
875 … P(ctx->propagator)->strokeTrim(begin, end, trimpath->type == LottieTrimpath::Type::Simultaneous); in updateTrimpath()
876 ctx->merging = nullptr; in updateTrimpath()
885 auto ctx = contexts.front(); in updateChildren() local
886 ctx->reqFragment = parent->reqFragment; in updateChildren()
887 for (auto child = ctx->begin; child >= parent->children.data; --child) { in updateChildren()
891 updateGroup(parent, child, frameNo, contexts, ctx); in updateChildren()
895 updateTransform(parent, child, frameNo, contexts, ctx); in updateChildren()
899 updateSolidFill(parent, child, frameNo, contexts, ctx); in updateChildren()
903 updateSolidStroke(parent, child, frameNo, contexts, ctx); in updateChildren()
907 updateGradientFill(parent, child, frameNo, contexts, ctx); in updateChildren()
911 updateGradientStroke(parent, child, frameNo, contexts, ctx); in updateChildren()
915 updateRect(parent, child, frameNo, contexts, ctx); in updateChildren()
919 updateEllipse(parent, child, frameNo, contexts, ctx); in updateChildren()
923 updatePath(parent, child, frameNo, contexts, ctx); in updateChildren()
927 updatePolystar(parent, child, frameNo, contexts, ctx); in updateChildren()
931 updateTrimpath(parent, child, frameNo, contexts, ctx); in updateChildren()
935 updateRepeater(parent, child, frameNo, contexts, ctx); in updateChildren()
939 updateRoundedCorner(parent, child, frameNo, contexts, ctx); in updateChildren()
943 updateOffsetPath(parent, child, frameNo, contexts, ctx); in updateChildren()
948 if (ctx->propagator->opacity() == 0) break; in updateChildren()
950 delete(ctx); in updateChildren()