diff options
author | Cary Clark <caryclark@skia.org> | 2018-07-17 13:19:56 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-17 17:27:10 +0000 |
commit | e80cd44cb2c549b709022a62a1fa9f8d6a7822ec (patch) | |
tree | 76b90d88c667317886c85002040c77ee9b07def9 /docs/SkCanvas_Reference.bmh | |
parent | a8cdbd7431b6a27d28db1bc80d7557cedf7e66d0 (diff) |
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 <caryclark@skia.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs/SkCanvas_Reference.bmh')
-rw-r--r-- | docs/SkCanvas_Reference.bmh | 44 |
1 files changed, 22 insertions, 22 deletions
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<const SkTextBlob> 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<const SkTextBlob> blob = textBlobBuilder.make(); + paint.reset(); + canvas->drawTextBlob(blob.get(), 0, 0, paint); +} ## #SeeAlso drawText drawPosText drawPosTextH |