From e80cd44cb2c549b709022a62a1fa9f8d6a7822ec Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 17 Jul 2018 13:19:56 -0400 Subject: fix bookmaker build bot Sync up with deletion of SkTransferFunctionBehavior. TBR=brianosman@google.com NOTRY=true Docs-Preview: https://skia.org/?cl=141828 Bug: skia:6818 Change-Id: Ibcfad17b8e886a4c980e4eb2bbae5a007f4bb36e Reviewed-on: https://skia-review.googlesource.com/141828 Commit-Queue: Cary Clark Commit-Queue: Brian Osman Auto-Submit: Cary Clark Reviewed-by: Brian Osman Reviewed-by: Cary Clark --- docs/SkCanvas_Reference.bmh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'docs/SkCanvas_Reference.bmh') diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index 32dee8193f..dabec688ea 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -5461,29 +5461,29 @@ Image_Filter, and Draw_Looper; apply to blob. #Example #Height 120 - void draw(SkCanvas* canvas) { - SkTextBlobBuilder textBlobBuilder; - const char bunny[] = "/(^x^)\\"; - const int len = sizeof(bunny) - 1; - uint16_t glyphs[len]; - SkPaint paint; - paint.textToGlyphs(bunny, len, glyphs); - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - int runs[] = { 3, 1, 3 }; - SkPoint textPos = { 20, 100 }; - int glyphIndex = 0; - for (auto runLen : runs) { - paint.setTextSize(1 == runLen ? 20 : 50); - const SkTextBlobBuilder::RunBuffer& run = - textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY); - memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen); - textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr); - glyphIndex += runLen; - } - sk_sp blob = textBlobBuilder.make(); - paint.reset(); - canvas->drawTextBlob(blob.get(), 0, 0, paint); +void draw(SkCanvas* canvas) { + SkTextBlobBuilder textBlobBuilder; + const char bunny[] = "/(^x^)\\"; + const int len = sizeof(bunny) - 1; + uint16_t glyphs[len]; + SkPaint paint; + paint.textToGlyphs(bunny, len, glyphs); + paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); + int runs[] = { 3, 1, 3 }; + SkPoint textPos = { 20, 100 }; + int glyphIndex = 0; + for (auto runLen : runs) { + paint.setTextSize(1 == runLen ? 20 : 50); + const SkTextBlobBuilder::RunBuffer& run = + textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY); + memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen); + textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr); + glyphIndex += runLen; } + sk_sp blob = textBlobBuilder.make(); + paint.reset(); + canvas->drawTextBlob(blob.get(), 0, 0, paint); +} ## #SeeAlso drawText drawPosText drawPosTextH -- cgit v1.2.3