Loading core/jni/android/graphics/TextLayout.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ jint TextLayout::layoutLine(const jchar* text, jint len, jint flags, int &dir, j } bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, const jchar** outText, int32_t* outBytes) { const jchar** outText, int32_t* outBytes, jchar** outBuffer) { const jchar *workText = text; jchar *buffer = NULL; int dir = kDirection_LTR; Loading Loading @@ -196,8 +196,8 @@ bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint *outBytes = (workLimit - workText) << 1; *outText = workText; *outBuffer = buffer; free(buffer); return true; } Loading @@ -207,8 +207,9 @@ bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, jfloat x, jfloat y,SkCanvas *canvas, SkPath *path) { const jchar *workText; jchar *buffer = NULL; int32_t workBytes; if (prepareText(paint, text, len, bidiFlags, &workText, &workBytes)) { if (prepareText(paint, text, len, bidiFlags, &workText, &workBytes, &buffer)) { SkScalar x_ = SkFloatToScalar(x); SkScalar y_ = SkFloatToScalar(y); if (canvas) { Loading @@ -216,6 +217,7 @@ void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, } else { paint->getTextPath(workText, workBytes, x_, y_, path); } free(buffer); } } Loading core/jni/android/graphics/TextLayout.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public: SkPath* path, SkCanvas* canvas); static bool prepareText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, const jchar** outText, int32_t* outBytes); const jchar** outText, int32_t* outBytes, jchar** outBuffer); private: static bool needsLayout(const jchar* text, jint len, jint bidiFlags); Loading core/jni/android_view_GLES20Canvas.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -256,9 +256,11 @@ static void android_view_GLES20Canvas_setupLinearShader(JNIEnv* env, jobject can static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, jfloat x, jfloat y, int flags, SkPaint* paint) { const jchar *workText; jchar* buffer = NULL; int32_t workBytes; if (TextLayout::prepareText(paint, text, count, flags, &workText, &workBytes)) { if (TextLayout::prepareText(paint, text, count, flags, &workText, &workBytes, &buffer)) { renderer->drawText((const char*) workText, workBytes, count, x, y, paint); free(buffer); } } Loading Loading
core/jni/android/graphics/TextLayout.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ jint TextLayout::layoutLine(const jchar* text, jint len, jint flags, int &dir, j } bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, const jchar** outText, int32_t* outBytes) { const jchar** outText, int32_t* outBytes, jchar** outBuffer) { const jchar *workText = text; jchar *buffer = NULL; int dir = kDirection_LTR; Loading Loading @@ -196,8 +196,8 @@ bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint *outBytes = (workLimit - workText) << 1; *outText = workText; *outBuffer = buffer; free(buffer); return true; } Loading @@ -207,8 +207,9 @@ bool TextLayout::prepareText(SkPaint *paint, const jchar* text, jsize len, jint void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, jfloat x, jfloat y,SkCanvas *canvas, SkPath *path) { const jchar *workText; jchar *buffer = NULL; int32_t workBytes; if (prepareText(paint, text, len, bidiFlags, &workText, &workBytes)) { if (prepareText(paint, text, len, bidiFlags, &workText, &workBytes, &buffer)) { SkScalar x_ = SkFloatToScalar(x); SkScalar y_ = SkFloatToScalar(y); if (canvas) { Loading @@ -216,6 +217,7 @@ void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len, } else { paint->getTextPath(workText, workBytes, x_, y_, path); } free(buffer); } } Loading
core/jni/android/graphics/TextLayout.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public: SkPath* path, SkCanvas* canvas); static bool prepareText(SkPaint *paint, const jchar* text, jsize len, jint bidiFlags, const jchar** outText, int32_t* outBytes); const jchar** outText, int32_t* outBytes, jchar** outBuffer); private: static bool needsLayout(const jchar* text, jint len, jint bidiFlags); Loading
core/jni/android_view_GLES20Canvas.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -256,9 +256,11 @@ static void android_view_GLES20Canvas_setupLinearShader(JNIEnv* env, jobject can static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, jfloat x, jfloat y, int flags, SkPaint* paint) { const jchar *workText; jchar* buffer = NULL; int32_t workBytes; if (TextLayout::prepareText(paint, text, count, flags, &workText, &workBytes)) { if (TextLayout::prepareText(paint, text, count, flags, &workText, &workBytes, &buffer)) { renderer->drawText((const char*) workText, workBytes, count, x, y, paint); free(buffer); } } Loading