Loading core/jni/android/graphics/Canvas.cpp +20 −6 Original line number Diff line number Diff line Loading @@ -755,15 +755,22 @@ public: jfloat x, jfloat y, int flags, SkPaint* paint) { jint count = end - start; sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, end, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, textArray, start, count, end, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, textArray, start, count, end, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(), x, y, flags, paint); } Loading @@ -772,15 +779,22 @@ public: int start, int count, int contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, contextCount, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, textArray, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, textArray, start, count, contextCount, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(), x, y, flags, paint); } Loading core/jni/android/graphics/TextLayout.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -254,21 +254,21 @@ void TextLayout::drawTextRun(SkPaint* paint, const jchar* chars, void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start, jint count, jint contextCount, jint dirFlags, jfloat* resultAdvances, jfloat& resultTotalAdvance) { sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE // Return advances from the cache. Compute them if needed sp<TextLayoutCacheValue> layout = gTextLayoutCache.getValue( value = gTextLayoutCache.getValue( paint, chars, start, count, contextCount, dirFlags); if (layout != NULL) { #else value = new TextLayoutCacheValue(); value->computeValues(paint, chars, start, count, contextCount, dirFlags); #endif if (value != NULL) { if (resultAdvances != NULL) { memcpy(resultAdvances, layout->getAdvances(), layout->getAdvancesCount() * sizeof(jfloat)); memcpy(resultAdvances, value->getAdvances(), value->getAdvancesCount() * sizeof(jfloat)); } resultTotalAdvance = layout->getTotalAdvance(); resultTotalAdvance = value->getTotalAdvance(); } #else // Compute advances and return them TextLayoutCacheValue::computeValuesWithHarfbuzz(paint, chars, start, count, contextCount, dirFlags, resultAdvances, &resultTotalAdvance, NULL, NULL ); #endif } void TextLayout::getTextRunAdvancesHB(SkPaint* paint, const jchar* chars, jint start, Loading core/jni/android_view_GLES20Canvas.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -438,12 +438,17 @@ 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 RTL_USE_HARFBUZZ sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, 0, count, count, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, text, 0, count, count, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, text, 0, count, count, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif Loading @@ -466,12 +471,17 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, jint start, jint count, jint contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { #if RTL_USE_HARFBUZZ sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, start, count, contextCount, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, text, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, text, start, count, contextCount, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif Loading Loading
core/jni/android/graphics/Canvas.cpp +20 −6 Original line number Diff line number Diff line Loading @@ -755,15 +755,22 @@ public: jfloat x, jfloat y, int flags, SkPaint* paint) { jint count = end - start; sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, end, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, textArray, start, count, end, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, textArray, start, count, end, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(), x, y, flags, paint); } Loading @@ -772,15 +779,22 @@ public: int start, int count, int contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, textArray, start, count, contextCount, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, textArray, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, textArray, start, count, contextCount, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(), x, y, flags, paint); } Loading
core/jni/android/graphics/TextLayout.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -254,21 +254,21 @@ void TextLayout::drawTextRun(SkPaint* paint, const jchar* chars, void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start, jint count, jint contextCount, jint dirFlags, jfloat* resultAdvances, jfloat& resultTotalAdvance) { sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE // Return advances from the cache. Compute them if needed sp<TextLayoutCacheValue> layout = gTextLayoutCache.getValue( value = gTextLayoutCache.getValue( paint, chars, start, count, contextCount, dirFlags); if (layout != NULL) { #else value = new TextLayoutCacheValue(); value->computeValues(paint, chars, start, count, contextCount, dirFlags); #endif if (value != NULL) { if (resultAdvances != NULL) { memcpy(resultAdvances, layout->getAdvances(), layout->getAdvancesCount() * sizeof(jfloat)); memcpy(resultAdvances, value->getAdvances(), value->getAdvancesCount() * sizeof(jfloat)); } resultTotalAdvance = layout->getTotalAdvance(); resultTotalAdvance = value->getTotalAdvance(); } #else // Compute advances and return them TextLayoutCacheValue::computeValuesWithHarfbuzz(paint, chars, start, count, contextCount, dirFlags, resultAdvances, &resultTotalAdvance, NULL, NULL ); #endif } void TextLayout::getTextRunAdvancesHB(SkPaint* paint, const jchar* chars, jint start, Loading
core/jni/android_view_GLES20Canvas.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -438,12 +438,17 @@ 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 RTL_USE_HARFBUZZ sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, 0, count, count, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, text, 0, count, count, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, text, 0, count, count, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif Loading @@ -466,12 +471,17 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, jint start, jint count, jint contextCount, jfloat x, jfloat y, int flags, SkPaint* paint) { #if RTL_USE_HARFBUZZ sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue( paint, text, start, count, contextCount, flags); sp<TextLayoutCacheValue> value; #if USE_TEXT_LAYOUT_CACHE value = gTextLayoutCache.getValue(paint, text, start, count, contextCount, flags); if (value == NULL) { LOGE("Cannot get TextLayoutCache value"); return ; } #else value = new TextLayoutCacheValue(); value->computeValues(paint, text, start, count, contextCount, flags); #endif #if DEBUG_GLYPHS logGlyphs(value); #endif Loading