Skip to content

Commit 292ece8

Browse files
HalCanarySkia Commit-Bot
authored and
Skia Commit-Bot
committed
SkCanvas::drawText: remove calls
Change-Id: Id5a870d9b94ce5510fd6e0fd75f52550e598139b Reviewed-on: https://skia-review.googlesource.com/c/182449 Commit-Queue: Mike Reed <[email protected]> Auto-Submit: Hal Canary <[email protected]> Reviewed-by: Mike Reed <[email protected]>
1 parent ac907bd commit 292ece8

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

include/core/SkPaint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ class SK_API SkPaint {
11591159
friend class SkFont;
11601160
friend class SkGlyphRunListPainter;
11611161
friend class SkPaintPriv;
1162+
friend class SkPicturePlayback;
11621163
friend class SkPDFDevice;
11631164
friend class SkScalerContext; // for computeLuminanceColor()
11641165
friend class SkTextBaseIter;

src/core/SkPicturePlayback.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,9 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
578578
BREAK_ON_READ_ERROR(reader);
579579

580580
if (paint && text.text()) {
581-
canvas->drawText(text.text(), text.length(), x, y, *paint);
581+
canvas->drawSimpleText(text.text(), text.length(),
582+
paint->private_internal_getTextEncoding(),
583+
x, y, SkFont::LEGACY_ExtractFromPaint(*paint), *paint);
582584
}
583585
} break;
584586
case DRAW_TEXT_BLOB: {
@@ -606,7 +608,9 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
606608
float top = ptr[2];
607609
float bottom = ptr[3];
608610
if (top < clip.fBottom && bottom > clip.fTop && paint && text.text()) {
609-
canvas->drawText(text.text(), text.length(), ptr[0], ptr[1], *paint);
611+
canvas->drawSimpleText(text.text(), text.length(),
612+
paint->private_internal_getTextEncoding(), ptr[0], ptr[1],
613+
SkFont::LEGACY_ExtractFromPaint(*paint), *paint);
610614
}
611615
} break;
612616
case DRAW_TEXT_ON_PATH_RETIRED_08_2018_REMOVED_10_2018: {

src/utils/SkLua.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,11 @@ static int lcanvas_drawText(lua_State* L) {
559559
if (lua_isstring(L, 2) && lua_isnumber(L, 3) && lua_isnumber(L, 4)) {
560560
size_t len;
561561
const char* text = lua_tolstring(L, 2, &len);
562-
get_ref<SkCanvas>(L, 1)->drawText(text, len,
563-
lua2scalar(L, 3), lua2scalar(L, 4),
564-
*get_obj<SkPaint>(L, 5));
562+
get_ref<SkCanvas>(L, 1)->drawSimpleText(
563+
text, len, kUTF8_SkTextEncoding,
564+
lua2scalar(L, 3), lua2scalar(L, 4),
565+
SkFont::LEGACY_ExtractFromPaint(*get_obj<SkPaint>(L, 5)),
566+
*get_obj<SkPaint>(L, 5));
565567
}
566568
return 0;
567569
}

0 commit comments

Comments
 (0)