Loading core/jni/android/graphics/Canvas.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -779,15 +779,8 @@ public: // TODO: need to suppress this code after the GL renderer is modified for not // copying the paint // Save old text encoding SkPaint::TextEncoding oldEncoding = paint->getTextEncoding(); // Define Glyph encoding paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); // Beware: this needs Glyph encoding (already done on the Paint constructor) canvas->drawText(glyphArray + index * 2, count * 2, x, y, *paint); // Get back old encoding paint->setTextEncoding(oldEncoding); } static void drawTextRun___CIIIIFFIPaint( Loading core/jni/android/graphics/Paint.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,8 @@ static jclass gFontMetricsInt_class; static JMetricsID gFontMetricsInt_fieldID; static void defaultSettingsForAndroid(SkPaint* paint) { // utf16 is required for java paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); // GlyphID encoding is required because we are using Harfbuzz shaping paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); } class SkPaintGlue { Loading core/jni/android/graphics/TextLayout.cpp +5 −16 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ bool TextLayout::needsLayout(const jchar* text, jint len, jint bidiFlags) { // This will draw if canvas is not null, otherwise path must be non-null and it will create // a path representing the text that would have been drawn. void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, jfloat x, jfloat y,SkCanvas *canvas, SkPath *path) { jint bidiFlags, jfloat x, jfloat y, SkPath *path) { sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE // Return advances from the cache. Compute them if needed Loading @@ -70,12 +70,9 @@ void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, } SkScalar x_ = SkFloatToScalar(x); SkScalar y_ = SkFloatToScalar(y); if (canvas) { canvas->drawText(value->getGlyphs(), value->getGlyphsCount() * 2, x_, y_, *paint); } else { // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->getTextPath(value->getGlyphs(), value->getGlyphsCount() * 2, x_, y_, path); } } void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start, jint count, jint contextCount, jint dirFlags, Loading Loading @@ -113,7 +110,7 @@ void TextLayout::getTextRunAdvancesICU(SkPaint* paint, const jchar* chars, jint void TextLayout::getTextPath(SkPaint *paint, const jchar *text, jsize len, jint bidiFlags, jfloat x, jfloat y, SkPath *path) { handleText(paint, text, len, bidiFlags, x, y, NULL, path); handleText(paint, text, len, bidiFlags, x, y, path); } Loading Loading @@ -143,16 +140,8 @@ void TextLayout::drawTextOnPath(SkPaint* paint, const jchar* text, int count, String8(text, count).string()); return ; } // Save old text encoding SkPaint::TextEncoding oldEncoding = paint->getTextEncoding(); // Define Glyph encoding paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); // Beware: this needs Glyph encoding (already done on the Paint constructor) canvas->drawTextOnPathHV(value->getGlyphs(), value->getGlyphsCount() * 2, *path, h_, v_, *paint); // Get back old encoding paint->setTextEncoding(oldEncoding); } void TextLayout::computeAdvancesWithICU(SkPaint* paint, const UChar* chars, Loading core/jni/android/graphics/TextLayout.h +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ private: static bool needsLayout(const jchar* text, jint len, jint bidiFlags); static void handleText(SkPaint* paint, const jchar* text, jsize len, int bidiFlags, jfloat x, jfloat y, SkCanvas* canvas, SkPath* path); int bidiFlags, jfloat x, jfloat y, SkPath* path); static void computeAdvancesWithICU(SkPaint* paint, const UChar* chars, size_t start, size_t count, size_t contextCount, int dirFlags, Loading libs/hwui/DisplayListRenderer.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -1210,10 +1210,8 @@ void DisplayListRenderer::drawText(const char* text, int bytesCount, int count, // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif addPaint(paint); addFloat(length < 0.0f ? paint->measureText(text, bytesCount) : length); } Loading Loading
core/jni/android/graphics/Canvas.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -779,15 +779,8 @@ public: // TODO: need to suppress this code after the GL renderer is modified for not // copying the paint // Save old text encoding SkPaint::TextEncoding oldEncoding = paint->getTextEncoding(); // Define Glyph encoding paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); // Beware: this needs Glyph encoding (already done on the Paint constructor) canvas->drawText(glyphArray + index * 2, count * 2, x, y, *paint); // Get back old encoding paint->setTextEncoding(oldEncoding); } static void drawTextRun___CIIIIFFIPaint( Loading
core/jni/android/graphics/Paint.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,8 @@ static jclass gFontMetricsInt_class; static JMetricsID gFontMetricsInt_fieldID; static void defaultSettingsForAndroid(SkPaint* paint) { // utf16 is required for java paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); // GlyphID encoding is required because we are using Harfbuzz shaping paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); } class SkPaintGlue { Loading
core/jni/android/graphics/TextLayout.cpp +5 −16 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ bool TextLayout::needsLayout(const jchar* text, jint len, jint bidiFlags) { // This will draw if canvas is not null, otherwise path must be non-null and it will create // a path representing the text that would have been drawn. void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, jfloat x, jfloat y,SkCanvas *canvas, SkPath *path) { jint bidiFlags, jfloat x, jfloat y, SkPath *path) { sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE // Return advances from the cache. Compute them if needed Loading @@ -70,12 +70,9 @@ void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, } SkScalar x_ = SkFloatToScalar(x); SkScalar y_ = SkFloatToScalar(y); if (canvas) { canvas->drawText(value->getGlyphs(), value->getGlyphsCount() * 2, x_, y_, *paint); } else { // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->getTextPath(value->getGlyphs(), value->getGlyphsCount() * 2, x_, y_, path); } } void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start, jint count, jint contextCount, jint dirFlags, Loading Loading @@ -113,7 +110,7 @@ void TextLayout::getTextRunAdvancesICU(SkPaint* paint, const jchar* chars, jint void TextLayout::getTextPath(SkPaint *paint, const jchar *text, jsize len, jint bidiFlags, jfloat x, jfloat y, SkPath *path) { handleText(paint, text, len, bidiFlags, x, y, NULL, path); handleText(paint, text, len, bidiFlags, x, y, path); } Loading Loading @@ -143,16 +140,8 @@ void TextLayout::drawTextOnPath(SkPaint* paint, const jchar* text, int count, String8(text, count).string()); return ; } // Save old text encoding SkPaint::TextEncoding oldEncoding = paint->getTextEncoding(); // Define Glyph encoding paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); // Beware: this needs Glyph encoding (already done on the Paint constructor) canvas->drawTextOnPathHV(value->getGlyphs(), value->getGlyphsCount() * 2, *path, h_, v_, *paint); // Get back old encoding paint->setTextEncoding(oldEncoding); } void TextLayout::computeAdvancesWithICU(SkPaint* paint, const UChar* chars, Loading
core/jni/android/graphics/TextLayout.h +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ private: static bool needsLayout(const jchar* text, jint len, jint bidiFlags); static void handleText(SkPaint* paint, const jchar* text, jsize len, int bidiFlags, jfloat x, jfloat y, SkCanvas* canvas, SkPath* path); int bidiFlags, jfloat x, jfloat y, SkPath* path); static void computeAdvancesWithICU(SkPaint* paint, const UChar* chars, size_t start, size_t count, size_t contextCount, int dirFlags, Loading
libs/hwui/DisplayListRenderer.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -1210,10 +1210,8 @@ void DisplayListRenderer::drawText(const char* text, int bytesCount, int count, // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif addPaint(paint); addFloat(length < 0.0f ? paint->measureText(text, bytesCount) : length); } Loading