mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
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
This commit is contained in:
1 parent
1a12919dea
commit
e08412d9a1
4 files changed
+201
-9
No files matched your search
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "TextMeasureCache.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {} // namespace react
|
||||
} // namespace facebook
|
||||
Reference in new issue
Block a user