Cache the flag value

Accessing flags in native is costly and should not be done during
layout calculation.

Bug: 308950033
Test: atest StaticLayoutGetOffsetForHorizontalPerfTest
Change-Id: I72ec6b3a531eff593311f2142d40351affcc638b
1 file changed