DALi Version 1.3.41
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / third-party / yoga / YGLayout.h
1 /**
2  * Copyright (c) 2014-present, Facebook, Inc.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7
8 #pragma once
9 #include "YGFloatOptional.h"
10 #include "Yoga-internal.h"
11
12 struct YGLayout {
13   std::array<float, 4> position;
14   std::array<float, 2> dimensions;
15   std::array<float, 6> margin;
16   std::array<float, 6> border;
17   std::array<float, 6> padding;
18   YGDirection direction;
19
20   uint32_t computedFlexBasisGeneration;
21   YGFloatOptional computedFlexBasis;
22   bool hadOverflow;
23
24   // Instead of recomputing the entire layout every single time, we
25   // cache some information to break early when nothing changed
26   uint32_t generationCount;
27   YGDirection lastOwnerDirection;
28
29   uint32_t nextCachedMeasurementsIndex;
30   std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>
31       cachedMeasurements;
32   std::array<float, 2> measuredDimensions;
33
34   YGCachedMeasurement cachedLayout;
35   bool didUseLegacyFlag;
36   bool doesLegacyStretchFlagAffectsLayout;
37
38   YGLayout();
39
40   bool operator==(const YGLayout& layout) const;
41   bool operator!=(const YGLayout& layout) const;
42 };