Allow lazy resolution of edge dimension values (#1453)
Summary: X-link: https://github.com/facebook/react-native/pull/41347 Pull Request resolved: https://github.com/facebook/yoga/pull/1453 This follows the previous patterns used for `Gutters` and `Dimension`, where we hide CompactValue array implementation from `yoga::Style` callers. This allows a single read of a style to only need access to the resolved values of a single edge, vs all edges. This is cheap now because the interface is the representation, but gets expensive if `StyleValuePool` is the actual implementation. This prevents us from needing to resolve nine dimensions, in order to read a single value like `marginLeft`. Doing this, in the new style, also lets us remove `IdxRef` from the API. We unroll the structure dependent parts in the props parsing code, for something more verbose, but also a bit clearer. Changelog: [Internal] Reviewed By: joevilches Differential Revision: D50998164 fbshipit-source-id: 248396f9587e29d62cde05ae7512d8194f60c809
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bb892af3a4
commit
f2c8acad2c
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <yoga/debug/AssertFatal.h>
|
||||
#include <yoga/enums/Dimension.h>
|
||||
#include <yoga/enums/Direction.h>
|
||||
#include <yoga/enums/FlexDirection.h>
|
||||
|
||||
namespace facebook::yoga {
|
||||
|
Reference in New Issue
Block a user