When returning a StaticLayout.Builder object to the pool, it is
important to clear everything out. If not, then the object may have
stale state from a previous layout operation. This was causing CTS
test failures and probably other mischief.
Bug:
20636917
Change-Id: I76fb20076ee954fcb476131a8fbe8833d72fbc0d
b.mEllipsizedWidth = width;
b.mEllipsize = null;
b.mMaxLines = Integer.MAX_VALUE;
+ b.mBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
b.mMeasuredText = MeasuredText.obtain();
return b;
b.mPaint = null;
b.mText = null;
MeasuredText.recycle(b.mMeasuredText);
+ b.mMeasuredText = null;
+ nFinishBuilder(b.mNativePtr);
sPool.release(b);
}