Merge "Make measureText(String, int, int) not use context" into mnc-dev

This commit is contained in:
Raph Levien
2015-06-24 21:12:33 +00:00
committed by Android (Google) Code Review

View File

@@ -606,7 +606,9 @@ public:
Layout layout; Layout layout;
TypefaceImpl* typeface = getNativeTypeface(env, jpaint); TypefaceImpl* typeface = getNativeTypeface(env, jpaint);
MinikinUtils::doLayout(&layout, paint, bidiFlags, typeface, textArray, start, count, textLength); // Only the substring is used for measurement, so no additional context is passed in. This
// behavior is consistent between char[] and String specializations.
MinikinUtils::doLayout(&layout, paint, bidiFlags, typeface, textArray + start, 0, count, count);
width = layout.getAdvance(); width = layout.getAdvance();
env->ReleaseStringChars(text, textArray); env->ReleaseStringChars(text, textArray);