Lines Matching defs:ctx

29 static SkFont ResolveFont(const SkSVGRenderContext& ctx) {
66 const auto& family = ctx.presentationContext().fInherited.fFontFamily->family();
67 const SkFontStyle style(weight(*ctx.presentationContext().fInherited.fFontWeight),
69 slant(*ctx.presentationContext().fInherited.fFontStyle));
72 ctx.lengthContext().resolve(ctx.presentationContext().fInherited.fFontSize->size(),
77 auto tf = ctx.fontMgr()->legacyMakeTypeface(family.c_str(), style);
228 SkSVGTextContext::SkSVGTextContext(const SkSVGRenderContext& ctx, const ShapedTextCallback& cb,
230 : fRenderContext(ctx)
232 , fShaper(SkShaper::Make(ctx.fontMgr()))
233 , fChunkAlignmentFactor(ComputeAlignmentFactor(ctx.presentationContext()))
236 fPathData = std::make_unique<PathData>(ctx, *tpath);
262 void SkSVGTextContext::shapeFragment(const SkString& txt, const SkSVGRenderContext& ctx,
297 fCurrentFill = ctx.fillPaint();
298 fCurrentStroke = ctx.strokePaint();
300 const auto font = ResolveFont(ctx);
324 this->flushChunk(ctx);
352 SkSVGTextContext::PathData::PathData(const SkSVGRenderContext& ctx, const SkSVGTextPath& tpath)
354 const auto ref = ctx.findNodeById(tpath.getHref());
359 SkContourMeasureIter cmi(ref->asPath(ctx), false);
411 void SkSVGTextContext::flushChunk(const SkSVGRenderContext& ctx) {
424 fCallback(ctx, blobBuilder.make(), run.fillPaint.get(), run.strokePaint.get());
429 fChunkAlignmentFactor = ComputeAlignmentFactor(ctx.presentationContext());
474 void SkSVGTextFragment::renderText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
478 SkSVGRenderContext localContext(ctx);
511 void SkSVGTextContainer::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
515 const SkSVGTextContext::ScopedPosResolver resolver(*this, ctx.lengthContext(), tctx);
519 frag->renderText(ctx, tctx, this->getXmlSpace());
546 void SkSVGTextLiteral::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
550 tctx->shapeFragment(this->getText(), ctx, xs);
553 void SkSVGText::onRender(const SkSVGRenderContext& ctx) const {
554 const SkSVGTextContext::ShapedTextCallback render_text = [](const SkSVGRenderContext& ctx,
559 ctx.canvas()->drawTextBlob(blob, 0, 0, *fill);
562 ctx.canvas()->drawTextBlob(blob, 0, 0, *stroke);
567 SkSVGTextContext tctx(ctx, render_text);
569 this->onShapeText(ctx, &tctx, this->getXmlSpace());
572 SkRect SkSVGText::onObjectBoundingBox(const SkSVGRenderContext& ctx) const {
576 [&bounds](const SkSVGRenderContext& ctx, const sk_sp<SkTextBlob>& blob, const SkPaint*,
598 SkSVGTextContext tctx(ctx, compute_bounds);
599 this->onShapeText(ctx, &tctx, this->getXmlSpace());
605 SkPath SkSVGText::onAsPath(const SkSVGRenderContext& ctx) const {
609 [&builder](const SkSVGRenderContext& ctx, const sk_sp<SkTextBlob>& blob, const SkPaint*,
641 SkSVGTextContext tctx(ctx, as_path);
642 this->onShapeText(ctx, &tctx, this->getXmlSpace());
651 void SkSVGTextPath::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* parent_tctx,
656 SkSVGTextContext tctx(ctx, parent_tctx->getCallback(), this);
658 this->INHERITED::onShapeText(ctx, &tctx, xs);