Commit Graph

1 Commits

Author SHA1 Message Date
Valentin Shergin e08412d9a1 Fabric: Text Measuring: TextMeasureCache the new, improved text measure cache
Summary:
Special thanks for Joshua Gross for flagging this problem!

This diff implements a custom evicting hash map designed specially to hold text measurement information. The key feature of this is custom equality checks and hashing functions.

They are designed around the following principals:
* Decorative text attributes (such as color, shadows, etc) has no effect on layout, therefore they should not be taking into account;
* `minimum height`, `minimum width`, and `maximum height` don't affect the measurement;
* the value of `layout metrics` are important only for `attachment` fragments.

After I redo all tests, I will enable this for Android-specific TextLayoutManager in separate diff.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18848583

fbshipit-source-id: 46c2fc445fbd1823afc5e7498e37de75381258b1
2019-12-06 10:54:13 -08:00