Lines Matching defs:const
29 static SkFont ResolveFont(const SkSVGRenderContext& ctx) {
30 auto weight = [](const SkSVGFontWeight& w) {
53 auto slant = [](const SkSVGFontStyle& s) {
66 const auto& family = ctx.presentationContext().fInherited.fFontFamily->family();
67 const SkFontStyle style(weight(*ctx.presentationContext().fInherited.fFontWeight),
71 const auto size =
89 static std::vector<float> ResolveLengths(const SkSVGLengthContext& lctx,
90 const std::vector<SkSVGLength>& lengths,
95 for (const auto& l : lengths) {
102 static float ComputeAlignmentFactor(const SkSVGPresentationContext& pctx) {
116 SkSVGTextContext::ScopedPosResolver::ScopedPosResolver(const SkSVGTextContainer& txt,
117 const SkSVGLengthContext& lctx,
132 SkSVGTextContext::ScopedPosResolver::ScopedPosResolver(const SkSVGTextContainer& txt,
133 const SkSVGLengthContext& lctx,
141 SkSVGTextContext::PosAttrs SkSVGTextContext::ScopedPosResolver::resolve(size_t charIndex) const {
146 const auto localCharIndex = charIndex - fCharIndexOffset;
148 const auto hasAllLocal = localCharIndex < fX.size() &&
213 const auto utf8_len = SkToInt(SkUTF::ToUTF8(ch, utf8_buf));
218 void SkSVGTextContext::shapePendingBuffer(const SkFont& font) {
220 const auto LTR = true;
228 SkSVGTextContext::SkSVGTextContext(const SkSVGRenderContext& ctx, const ShapedTextCallback& cb,
229 const SkSVGTextPath* tpath)
239 auto resolve_offset = [this](const SkSVGLength& offset) {
262 void SkSVGTextContext::shapeFragment(const SkString& txt, const SkSVGRenderContext& ctx,
300 const auto font = ResolveFont(ctx);
303 const char* ch_ptr = txt.c_str();
304 const char* ch_end = ch_ptr + txt.size();
318 const auto pos = fPosResolver->resolve(fCurrentCharIndex++);
352 SkSVGTextContext::PathData::PathData(const SkSVGRenderContext& ctx, const SkSVGTextPath& tpath)
354 const auto ref = ctx.findNodeById(tpath.getHref());
366 SkMatrix SkSVGTextContext::PathData::getMatrixAt(float offset) const {
368 for (const auto& contour : fContours) {
369 const auto contour_len = contour->length();
383 SkRSXform SkSVGTextContext::computeGlyphXform(SkGlyphID glyph, const SkFont& font,
384 const SkPoint& glyph_pos,
385 const PositionAdjustment& pos_adjust) const {
404 const auto m = fPathData->getMatrixAt(path_offset) *
411 void SkSVGTextContext::flushChunk(const SkSVGRenderContext& ctx) {
414 for (const auto& run : fRuns) {
415 const auto& buf = blobBuilder.allocRunRSXform(run.font, SkToInt(run.glyphCount));
434 SkShaper::RunHandler::Buffer SkSVGTextContext::runBuffer(const RunInfo& ri) {
460 void SkSVGTextContext::commitRunBuffer(const RunInfo& ri) {
461 const auto& current_run = fRuns.back();
465 const auto utf8_index = fShapeClusterBuffer[i];
474 void SkSVGTextFragment::renderText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
475 SkSVGXmlSpace xs) const {
485 SkPath SkSVGTextFragment::onAsPath(const SkSVGRenderContext&) const {
511 void SkSVGTextContainer::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
512 SkSVGXmlSpace) const {
515 const SkSVGTextContext::ScopedPosResolver resolver(*this, ctx.lengthContext(), tctx);
517 for (const auto& frag : fChildren) {
526 static constexpr std::tuple<const char*, SkSVGXmlSpace> gXmlSpaceMap[] = {
534 bool SkSVGTextContainer::parseAndSetAttribute(const char* name, const char* value) {
546 void SkSVGTextLiteral::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
547 SkSVGXmlSpace xs) const {
553 void SkSVGText::onRender(const SkSVGRenderContext& ctx) const {
554 const SkSVGTextContext::ShapedTextCallback render_text = [](const SkSVGRenderContext& ctx,
555 const sk_sp<SkTextBlob>& blob,
556 const SkPaint* fill,
557 const SkPaint* stroke) {
572 SkRect SkSVGText::onObjectBoundingBox(const SkSVGRenderContext& ctx) const {
575 const SkSVGTextContext::ShapedTextCallback compute_bounds =
576 [&bounds](const SkSVGRenderContext& ctx, const sk_sp<SkTextBlob>& blob, const SkPaint*,
577 const SkPaint*) {
605 SkPath SkSVGText::onAsPath(const SkSVGRenderContext& ctx) const {
608 const SkSVGTextContext::ShapedTextCallback as_path =
609 [&builder](const SkSVGRenderContext& ctx, const sk_sp<SkTextBlob>& blob, const SkPaint*,
610 const SkPaint*) {
618 const SkRSXform* xform;
621 it.font().getPaths(it.glyphs(), it.glyphCount(), [](const SkPath* path,
622 const SkMatrix& matrix,
625 const auto& glyph_rsx = *get_paths_ctx->xform++;
651 void SkSVGTextPath::onShapeText(const SkSVGRenderContext& ctx, SkSVGTextContext* parent_tctx,
652 SkSVGXmlSpace xs) const {
661 bool SkSVGTextPath::parseAndSetAttribute(const char* name, const char* value) {