Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35844a3a authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Fix bug #4415576 Gmail text looks broken"

parents 9f4b95b9 8fb50717
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -770,7 +770,7 @@ public:

        jint count = end - start;
        sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue(
                paint, textArray, start, count, count, flags);
                paint, textArray, start, count, end, flags);
        if (value == NULL) {
            LOGE("Cannot get TextLayoutCache value");
            return ;
+8 −8
Original line number Diff line number Diff line
@@ -335,8 +335,8 @@ public:
        const jchar* textArray = env->GetCharArrayElements(text, NULL);
        jfloat result = 0;
#if RTL_USE_HARFBUZZ
        TextLayout::getTextRunAdvances(paint, textArray, index, count, count, paint->getFlags(),
                NULL /* dont need all advances */, result);
        TextLayout::getTextRunAdvances(paint, textArray, index, count, textLength,
                paint->getFlags(), NULL /* dont need all advances */, result);
#else
        // we double count, since measureText wants a byteLength
        SkScalar width = paint->measureText(textArray + index, count << 1);
@@ -362,8 +362,8 @@ public:
        jfloat width = 0;

#if RTL_USE_HARFBUZZ
        TextLayout::getTextRunAdvances(paint, textArray, 0, count, count, paint->getFlags(),
                NULL /* dont need all advances */, width);
        TextLayout::getTextRunAdvances(paint, textArray, start, count, end,
                paint->getFlags(), NULL /* dont need all advances */, width);
#else

        width = SkScalarToFloat(paint->measureText(textArray + start, count << 1));
@@ -381,8 +381,8 @@ public:
        size_t textLength = env->GetStringLength(text);
        jfloat width = 0;
#if RTL_USE_HARFBUZZ
        TextLayout::getTextRunAdvances(paint, textArray, 0, textLength, textLength, paint->getFlags(),
                NULL /* dont need all advances */, width);
        TextLayout::getTextRunAdvances(paint, textArray, 0, textLength, textLength,
                paint->getFlags(), NULL /* dont need all advances */, width);
#else
        width = SkScalarToFloat(paint->measureText(textArray, textLength << 1));
#endif
@@ -396,8 +396,8 @@ public:
#if RTL_USE_HARFBUZZ
        jfloat totalAdvance;

        TextLayout::getTextRunAdvances(paint, text, 0, count, count, paint->getFlags(),
                widthsArray, totalAdvance);
        TextLayout::getTextRunAdvances(paint, text, 0, count, count,
                paint->getFlags(), widthsArray, totalAdvance);
#else
        SkScalar* scalarArray = (SkScalar*)widthsArray;