Preload font before TypefaceSerializationPerfTest.

This CL disables lazy font loading by preloading font in setUp(),
in order to stabilize testSerializeFontMap() results.

In testSerializeFontMap(), the first serializeFontMap() takes 20x time
due to lazy font loading (first call 40ms / avg 2ms on oriole).
This makes test results unstable by reducing the number of iterations.

ManualBenchmarkState calculates the number of iterations
('mMaxIterations') as follows:
    mMaxIterations = (int) (mTargetTestDurationNs / (warmupDuration / iterations));
where 'iterations' is the number of iterations done in warmup stage.
If the first iteration in warmup stage takes unusually long,
'iterations' becomes small and mMaxIterations will be smaller as well.

Bug: 239758440
Test: atest CorePerfTests:android.graphics.perftests.TypefaceSerializationPerfTest#testSerializeFontMap
Change-Id: I3181962a1807cb7b4ecbc8e26fe629b9f530e1c1
1 file changed