remove paint::glyphsToUnichars

Bug: skia:
Change-Id: I3f97a74f6d0a9da2711a50740d83d2181858bda8
Reviewed-on: https://skia-review.googlesource.com/c/184301
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2019-01-15 21:31:41 -05:00 committed by Skia Commit-Bot
parent c3061a3951
commit 47b7cd9a6b
3 changed files with 17 additions and 70 deletions

View File

@ -726,23 +726,23 @@ If Font_Linear is clear, it is the same as setting Hinting to SkFontHinting::kNo
#Example
#Height 128
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
const char testStr[] = "abcd efgh";
size_t count = 9;
for (int textSize : { 12, 24 } ) {
SkFont font(nullptr, textSize);
for (auto linearMetrics : { false, true } ) {
font.setLinearMetrics(linearMetrics);
SkString width;
width.appendScalar(font.measureText(testStr, count, SkTextEncoding::kUTF8));
canvas->translate(0, textSize + 4);
canvas->drawSimpleText(testStr, count, SkTextEncoding::kUTF8,
10, 0, font, paint);
canvas->drawSimpleText(width.c_str(), width.size(), SkTextEncoding::kUTF8,
128, 0, font, paint);
}
}
SkPaint paint;
paint.setAntiAlias(true);
const char testStr[] = "abcd efgh";
size_t count = 9;
for (int textSize : { 12, 24 } ) {
SkFont font(nullptr, textSize);
for (auto linearMetrics : { false, true } ) {
font.setLinearMetrics(linearMetrics);
SkString width;
width.appendScalar(font.measureText(testStr, count, SkTextEncoding::kUTF8));
canvas->translate(0, textSize + 4);
canvas->drawSimpleText(testStr, count, SkTextEncoding::kUTF8,
10, 0, font, paint);
canvas->drawSimpleText(width.c_str(), width.size(), SkTextEncoding::kUTF8,
128, 0, font, paint);
}
}
}
##
@ -3061,38 +3061,6 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
#Method void glyphsToUnichars(const SkGlyphID glyphs[],
int count, SkUnichar text[]) const
#In Utility
#Line # converts Glyphs into text ##
#Populate
# crashes fiddle, draws missing characters locally ##
#Bug 8608
#NoExample
#Height 64
#Description
Convert UTF-8 text to glyphs; then convert glyphs to Unichar code points.
##
void draw(SkCanvas* canvas) {
SkPaint paint;
const char hello[] = "Hello!";
const int count = sizeof(hello) - 1;
SkGlyphID glyphs[count];
if (count != paint.textToGlyphs(hello, count, glyphs)) {
return;
}
SkUnichar unichars[count];
paint.glyphsToUnichars(glyphs, count, unichars);
paint.setTextEncoding(kUTF32_SkTextEncoding);
canvas->drawText(unichars, sizeof(unichars), 10, 30, paint);
}
##
##
# ------------------------------------------------------------------------------
#Method bool nothingToDraw() const
#In Utility
#Line # returns true if Paint prevents all drawing ##

View File

@ -921,21 +921,6 @@ public:
bool containsText(const void* text, size_t byteLength) const;
#endif
#ifdef SK_SUPPORT_LEGACY_PAINT_FONT_FIELDS
/** Converts glyphs into text if possible.
Glyph values without direct Unicode equivalents are mapped to zero.
Uses the SkTypeface, but is unaffected
by SkTextEncoding; the text values returned are equivalent to kUTF32_SkTextEncoding.
Only supported on platforms that use FreeType as the font engine.
@param glyphs array of indices into font
@param count length of glyph array
@param text storage for character codes, one per glyph
*/
void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const;
#endif
#ifdef SK_SUPPORT_LEGACY_PAINT_TEXTMEASURE
/** Deprecated; use SkFont::countText instead
*/

View File

@ -78,12 +78,6 @@ bool SkPaint::containsText(const void* text, size_t length) const {
}
#endif
#ifdef SK_SUPPORT_LEGACY_PAINT_FONT_FIELDS
void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar textData[]) const {
SkFont::LEGACY_ExtractFromPaint(*this).glyphsToUnichars(glyphs, count, textData);
}
#endif
///////////////////////////////////////////////////////////////////////////////
static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache,