Loading core/jni/android/graphics/Canvas.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -764,13 +764,6 @@ public: env->ReleaseStringChars(text, textArray); } static void logGlyphs(sp<TextLayoutCacheValue> value) { LOGD("drawTextWithGlyphs -- got glyphs - count=%d", value->getGlyphsCount()); for (size_t i = 0; i < value->getGlyphsCount(); i++) { LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]); } } static void drawTextWithGlyphs(SkCanvas* canvas, const jchar* textArray, int start, int end, jfloat x, jfloat y, int flags, SkPaint* paint) { Loading @@ -779,7 +772,7 @@ public: sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, count, flags); if (value == NULL) { LOGE("drawTextWithGlyphs -- cannot get Cache value"); LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS Loading @@ -796,7 +789,7 @@ public: sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, contextCount, flags); if (value == NULL) { LOGE("drawTextWithGlyphs -- cannot get Cache value"); LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS Loading core/jni/android/graphics/TextLayout.h +8 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,14 @@ enum { kDirection_Mask = 0x1 }; static void logGlyphs(sp<TextLayoutCacheValue> value) { if (value == NULL) return; LOGD("Got glyphs - count=%d", value->getGlyphsCount()); for (size_t i = 0; i < value->getGlyphsCount(); i++) { LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]); } } class TextLayout { public: Loading core/jni/android_view_GLES20Canvas.cpp +30 −0 Original line number Diff line number Diff line Loading @@ -419,6 +419,20 @@ static void android_view_GLES20Canvas_setupShadow(JNIEnv* env, jobject clazz, static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, jfloat x, jfloat y, int flags, SkPaint* paint) { #if 0 // TODO: replace "0" by "RTL_USE_HARFBUZZ" when renderer->drawGlyphs() is implemented sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, 0, count, count, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS logGlyphs(value); #endif const jchar* glyphArray = value->getGlyphs(); int glyphCount = value->getGlyphsCount(); renderer->drawGlyphs((const char*) glyphArray, 0, glyphCount << 1, x, y, paint); #else const jchar *workText; jchar* buffer = NULL; int32_t workBytes; Loading @@ -426,11 +440,26 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, renderer->drawText((const char*) workText, workBytes, count, x, y, paint); free(buffer); } #endif } static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, jint start, jint count, jint contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { #if 0 // TODO: replace "0" by "RTL_USE_HARFBUZZ" when renderer->drawGlyphs() is implemented sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS logGlyphs(value); #endif const jchar* glyphArray = value->getGlyphs(); int glyphCount = value->getGlyphsCount(); renderer->drawGlyphs((const char*) glyphArray, 0, glyphCount << 1, x, y, paint); #else uint8_t rtl = flags & 0x1; if (rtl) { SkAutoSTMalloc<80, jchar> buffer(contextCount); Loading @@ -443,6 +472,7 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, } else { renderer->drawText((const char*) (text + start), count << 1, count, x, y, paint); } #endif } static void android_view_GLES20Canvas_drawTextArray(JNIEnv* env, jobject clazz, Loading libs/hwui/OpenGLRenderer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -2059,6 +2059,11 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, drawTextDecorations(text, bytesCount, length, oldX, oldY, paint); } void OpenGLRenderer::drawGlyphs(const char* glyphs, int index, int count, float x, float y, SkPaint* paint) { // TODO } void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) { if (mSnapshot->isIgnored()) return; Loading libs/hwui/OpenGLRenderer.h +2 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,8 @@ public: virtual void drawPoints(float* points, int count, SkPaint* paint); virtual void drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint); virtual void drawGlyphs(const char* glyphs, int index, int count, float x, float y, SkPaint* paint); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading Loading
core/jni/android/graphics/Canvas.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -764,13 +764,6 @@ public: env->ReleaseStringChars(text, textArray); } static void logGlyphs(sp<TextLayoutCacheValue> value) { LOGD("drawTextWithGlyphs -- got glyphs - count=%d", value->getGlyphsCount()); for (size_t i = 0; i < value->getGlyphsCount(); i++) { LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]); } } static void drawTextWithGlyphs(SkCanvas* canvas, const jchar* textArray, int start, int end, jfloat x, jfloat y, int flags, SkPaint* paint) { Loading @@ -779,7 +772,7 @@ public: sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, count, flags); if (value == NULL) { LOGE("drawTextWithGlyphs -- cannot get Cache value"); LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS Loading @@ -796,7 +789,7 @@ public: sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, contextCount, flags); if (value == NULL) { LOGE("drawTextWithGlyphs -- cannot get Cache value"); LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS Loading
core/jni/android/graphics/TextLayout.h +8 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,14 @@ enum { kDirection_Mask = 0x1 }; static void logGlyphs(sp<TextLayoutCacheValue> value) { if (value == NULL) return; LOGD("Got glyphs - count=%d", value->getGlyphsCount()); for (size_t i = 0; i < value->getGlyphsCount(); i++) { LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]); } } class TextLayout { public: Loading
core/jni/android_view_GLES20Canvas.cpp +30 −0 Original line number Diff line number Diff line Loading @@ -419,6 +419,20 @@ static void android_view_GLES20Canvas_setupShadow(JNIEnv* env, jobject clazz, static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, jfloat x, jfloat y, int flags, SkPaint* paint) { #if 0 // TODO: replace "0" by "RTL_USE_HARFBUZZ" when renderer->drawGlyphs() is implemented sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, 0, count, count, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS logGlyphs(value); #endif const jchar* glyphArray = value->getGlyphs(); int glyphCount = value->getGlyphsCount(); renderer->drawGlyphs((const char*) glyphArray, 0, glyphCount << 1, x, y, paint); #else const jchar *workText; jchar* buffer = NULL; int32_t workBytes; Loading @@ -426,11 +440,26 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, renderer->drawText((const char*) workText, workBytes, count, x, y, paint); free(buffer); } #endif } static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, jint start, jint count, jint contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { #if 0 // TODO: replace "0" by "RTL_USE_HARFBUZZ" when renderer->drawGlyphs() is implemented sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #if DEBUG_GLYPHS logGlyphs(value); #endif const jchar* glyphArray = value->getGlyphs(); int glyphCount = value->getGlyphsCount(); renderer->drawGlyphs((const char*) glyphArray, 0, glyphCount << 1, x, y, paint); #else uint8_t rtl = flags & 0x1; if (rtl) { SkAutoSTMalloc<80, jchar> buffer(contextCount); Loading @@ -443,6 +472,7 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, } else { renderer->drawText((const char*) (text + start), count << 1, count, x, y, paint); } #endif } static void android_view_GLES20Canvas_drawTextArray(JNIEnv* env, jobject clazz, Loading
libs/hwui/OpenGLRenderer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -2059,6 +2059,11 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, drawTextDecorations(text, bytesCount, length, oldX, oldY, paint); } void OpenGLRenderer::drawGlyphs(const char* glyphs, int index, int count, float x, float y, SkPaint* paint) { // TODO } void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) { if (mSnapshot->isIgnored()) return; Loading
libs/hwui/OpenGLRenderer.h +2 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,8 @@ public: virtual void drawPoints(float* points, int count, SkPaint* paint); virtual void drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint); virtual void drawGlyphs(const char* glyphs, int index, int count, float x, float y, SkPaint* paint); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading