diff options
author | Hal Canary <halcanary@google.com> | 2018-12-17 13:48:44 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-12-17 19:21:10 +0000 |
commit | fc97f222ff1f9dc496a4b277f0a41fac51b155b8 (patch) | |
tree | 68611d869d3d74f90cee832feef7d9195125c348 /fuzz | |
parent | b79ba57f202824c88605d3ab3c09c62d7e022ffb (diff) | |
download | skia-fc97f222ff1f9dc496a4b277f0a41fac51b155b8.tar.gz |
FuzzCanvas: do textToglyphs right
Bug: skia:8635
Change-Id: I6ceec131ae9cc5796a5aba6d5cfdb16de4831a45
Reviewed-on: https://skia-review.googlesource.com/c/178261
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/FuzzCanvas.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp index 2416f353d8..8ac43e87ff 100644 --- a/fuzz/FuzzCanvas.cpp +++ b/fuzz/FuzzCanvas.cpp @@ -995,24 +995,26 @@ static sk_sp<SkTextBlob> make_fuzz_textblob(Fuzz* fuzz) { const SkTextBlobBuilder::RunBuffer* buffer; uint8_t runType; fuzz->nextRange(&runType, (uint8_t)0, (uint8_t)2); + const void* textPtr = text.begin(); + size_t textLen = SkToSizeT(text.count()); switch (runType) { case 0: fuzz->next(&x, &y); // TODO: Test other variations of this. buffer = &textBlobBuilder.allocRun(font, glyphCount, x, y); - memcpy(buffer->glyphs, text.begin(), SkToSizeT(text.count())); + (void)font.textToGlyphs(textPtr, textLen, encoding, buffer->glyphs, glyphCount); break; case 1: fuzz->next(&y); // TODO: Test other variations of this. buffer = &textBlobBuilder.allocRunPosH(font, glyphCount, y); - memcpy(buffer->glyphs, text.begin(), SkToSizeT(text.count())); + (void)font.textToGlyphs(textPtr, textLen, encoding, buffer->glyphs, glyphCount); fuzz->nextN(buffer->pos, glyphCount); break; case 2: // TODO: Test other variations of this. buffer = &textBlobBuilder.allocRunPos(font, glyphCount); - memcpy(buffer->glyphs, text.begin(), SkToSizeT(text.count())); + (void)font.textToGlyphs(textPtr, textLen, encoding, buffer->glyphs, glyphCount); fuzz->nextN(buffer->pos, glyphCount * 2); break; default: |