Remove extraneous file
Summary: @public This file shouldn’t be here Reviewed By: SidharthGuglani Differential Revision: D13255658 fbshipit-source-id: 1b40ab674bbf451d04797516a24c3bd2fef7222d
This commit is contained in:
committed by
Facebook Github Bot
parent
6f6e0ce339
commit
98c1c180af
@@ -1,121 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include "Yoga.h"
|
||||
|
||||
using YGVector = std::vector<YGNodeRef>;
|
||||
|
||||
YG_EXTERN_C_BEGIN
|
||||
|
||||
WIN_EXPORT float YGRoundValueToPixelGrid(
|
||||
const float value,
|
||||
const float pointScaleFactor,
|
||||
const bool forceCeil,
|
||||
const bool forceFloor);
|
||||
|
||||
YG_EXTERN_C_END
|
||||
|
||||
extern const std::array<YGEdge, 4> trailing;
|
||||
extern const std::array<YGEdge, 4> leading;
|
||||
extern bool YGValueEqual(const YGValue a, const YGValue b);
|
||||
extern const YGValue YGValueUndefined;
|
||||
extern const YGValue YGValueAuto;
|
||||
extern const YGValue YGValueZero;
|
||||
|
||||
template <std::size_t size>
|
||||
bool YGValueArrayEqual(
|
||||
const std::array<YGValue, size> val1,
|
||||
const std::array<YGValue, size> val2) {
|
||||
bool areEqual = true;
|
||||
for (uint32_t i = 0; i < size && areEqual; ++i) {
|
||||
areEqual = YGValueEqual(val1[i], val2[i]);
|
||||
}
|
||||
return areEqual;
|
||||
}
|
||||
|
||||
const YGValue kYGValueUndefined = {YGUndefined, YGUnitUndefined};
|
||||
const YGValue kYGValueAuto = {YGUndefined, YGUnitAuto};
|
||||
const std::array<YGValue, YGEdgeCount> kYGDefaultEdgeValuesUnit = {
|
||||
{kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined,
|
||||
kYGValueUndefined}};
|
||||
const std::array<YGValue, 2> kYGDefaultDimensionValuesAutoUnit = {
|
||||
{kYGValueAuto, kYGValueAuto}};
|
||||
const std::array<YGValue, 2> kYGDefaultDimensionValuesUnit = {
|
||||
{kYGValueUndefined, kYGValueUndefined}};
|
||||
|
||||
struct YGCachedMeasurement {
|
||||
float availableWidth;
|
||||
float availableHeight;
|
||||
YGMeasureMode widthMeasureMode;
|
||||
YGMeasureMode heightMeasureMode;
|
||||
|
||||
float computedWidth;
|
||||
float computedHeight;
|
||||
|
||||
bool operator==(YGCachedMeasurement measurement) const {
|
||||
bool isEqual = widthMeasureMode == measurement.widthMeasureMode &&
|
||||
heightMeasureMode == measurement.heightMeasureMode;
|
||||
|
||||
if (!std::isnan(availableWidth) ||
|
||||
!std::isnan(measurement.availableWidth)) {
|
||||
isEqual = isEqual && availableWidth == measurement.availableWidth;
|
||||
}
|
||||
if (!std::isnan(availableHeight) ||
|
||||
!std::isnan(measurement.availableHeight)) {
|
||||
isEqual = isEqual && availableHeight == measurement.availableHeight;
|
||||
}
|
||||
if (!std::isnan(computedWidth) || !std::isnan(measurement.computedWidth)) {
|
||||
isEqual = isEqual && computedWidth == measurement.computedWidth;
|
||||
}
|
||||
if (!std::isnan(computedHeight) ||
|
||||
!std::isnan(measurement.computedHeight)) {
|
||||
isEqual = isEqual && computedHeight == measurement.computedHeight;
|
||||
}
|
||||
|
||||
return isEqual;
|
||||
}
|
||||
};
|
||||
|
||||
// This value was chosen based on empiracle data. Even the most complicated
|
||||
// layouts should not require more than 16 entries to fit within the cache.
|
||||
#define YG_MAX_CACHED_RESULT_COUNT 16
|
||||
|
||||
struct YGConfig {
|
||||
bool experimentalFeatures[YGExperimentalFeatureCount + 1];
|
||||
bool useWebDefaults;
|
||||
bool useLegacyStretchBehaviour;
|
||||
bool shouldDiffLayoutWithoutLegacyStretchBehaviour;
|
||||
float pointScaleFactor;
|
||||
YGLogger logger;
|
||||
YGNodeClonedFunc cloneNodeCallback;
|
||||
void* context;
|
||||
};
|
||||
|
||||
static const float kDefaultFlexGrow = 0.0f;
|
||||
static const float kDefaultFlexShrink = 0.0f;
|
||||
static const float kWebDefaultFlexShrink = 1.0f;
|
||||
|
||||
extern bool YGFloatsEqual(const float a, const float b);
|
||||
extern bool YGValueEqual(const YGValue a, const YGValue b);
|
||||
extern const YGValue* YGComputedEdgeValue(
|
||||
const std::array<YGValue, YGEdgeCount>& edges,
|
||||
const YGEdge edge,
|
||||
const YGValue* const defaultValue);
|
Reference in New Issue
Block a user