33 }
else if (length.
isAuto()) {
45 }
else if (sizeValue.
isAuto()) {
71 }
else if (handle.
isAuto()) {
90 }
else if (handle.
isAuto()) {
148 auto newIndex =
buffer_.
push(std::bit_cast<uint32_t>(value));
164 handle.
setValue(
static_cast<uint16_t
>(keyword));
169 constexpr uint16_t kMaxInlineAbsValue = (1 << 11) - 1;
171 auto i =
static_cast<int32_t
>(f);
172 return static_cast<float>(i) == f && i >= -kMaxInlineAbsValue &&
173 i <= +kMaxInlineAbsValue;
177 uint16_t isNegative = value < 0 ? 1 : 0;
178 return static_cast<uint16_t
>(
180 (
static_cast<int32_t
>(value) * (isNegative != 0u ? -1 : 1)));
184 constexpr uint16_t kValueSignMask = 0b0000'1000'0000'0000;
185 constexpr uint16_t kValueMagnitudeMask = 0b0000'0111'1111'1111;
186 const bool isNegative = (value & kValueSignMask) != 0;
187 return static_cast<float>(
188 (value & kValueMagnitudeMask) * (isNegative ? -1 : 1));
Definition SmallValueBuffer.h:23
uint16_t push(uint32_t value)
Definition SmallValueBuffer.h:32
uint16_t replace(uint16_t index, uint32_t value)
Definition SmallValueBuffer.h:68
uint32_t get32(uint16_t index) const
Definition SmallValueBuffer.h:96
Definition StyleLength.h:28
static constexpr StyleLength undefined()
Definition StyleLength.h:48
constexpr bool isUndefined() const
Definition StyleLength.h:56
constexpr FloatOptional value() const
Definition StyleLength.h:72
static constexpr StyleLength ofAuto()
Definition StyleLength.h:44
static constexpr StyleLength percent(float value)
Definition StyleLength.h:38
constexpr bool isPoints() const
Definition StyleLength.h:60
static constexpr StyleLength points(float value)
Definition StyleLength.h:32
constexpr bool isAuto() const
Definition StyleLength.h:52
Definition StyleSizeLength.h:29
constexpr bool isPoints() const
Definition StyleSizeLength.h:95
static constexpr StyleSizeLength ofMaxContent()
Definition StyleSizeLength.h:55
constexpr bool isStretch() const
Definition StyleSizeLength.h:83
static constexpr StyleSizeLength undefined()
Definition StyleSizeLength.h:67
static constexpr StyleSizeLength ofFitContent()
Definition StyleSizeLength.h:59
constexpr bool isFitContent() const
Definition StyleSizeLength.h:79
constexpr bool isMaxContent() const
Definition StyleSizeLength.h:75
static constexpr StyleSizeLength points(float value)
Definition StyleSizeLength.h:33
constexpr FloatOptional value() const
Definition StyleSizeLength.h:103
static constexpr StyleSizeLength percent(float value)
Definition StyleSizeLength.h:39
constexpr bool isAuto() const
Definition StyleSizeLength.h:71
constexpr bool isUndefined() const
Definition StyleSizeLength.h:87
static constexpr StyleSizeLength ofStretch()
Definition StyleSizeLength.h:63
static constexpr StyleSizeLength ofAuto()
Definition StyleSizeLength.h:51
Definition StyleValueHandle.h:32
constexpr bool isKeyword(Keyword keyword) const
Definition StyleValueHandle.h:79
constexpr bool isAuto() const
Definition StyleValueHandle.h:48
constexpr bool isUndefined() const
Definition StyleValueHandle.h:40
constexpr void setType(Type handleType)
Definition StyleValueHandle.h:87
constexpr void setValueIsIndexed()
Definition StyleValueHandle.h:105
Type
Definition StyleValueHandle.h:67
constexpr Type type() const
Definition StyleValueHandle.h:83
constexpr bool isValueIndexed() const
Definition StyleValueHandle.h:101
Keyword
Definition StyleValueHandle.h:77
constexpr uint16_t value() const
Definition StyleValueHandle.h:92
constexpr void setValue(uint16_t value)
Definition StyleValueHandle.h:96
Definition StyleValuePool.h:28
void store(StyleValueHandle &handle, StyleLength length)
Definition StyleValuePool.h:30
StyleSizeLength getSize(StyleValueHandle handle) const
Definition StyleValuePool.h:87
static constexpr float unpackInlineInteger(uint16_t value)
Definition StyleValuePool.h:183
StyleLength getLength(StyleValueHandle handle) const
Definition StyleValuePool.h:68
void storeValue(StyleValueHandle &handle, float value, StyleValueHandle::Type type)
Definition StyleValuePool.h:135
void store(StyleValueHandle &handle, StyleSizeLength sizeValue)
Definition StyleValuePool.h:42
float getStoredValue(StyleValueHandle handle) const
Definition StyleValuePool.h:124
void storeKeyword(StyleValueHandle &handle, StyleValueHandle::Keyword keyword)
Definition StyleValuePool.h:154
static constexpr bool isIntegerPackable(float f)
Definition StyleValuePool.h:168
FloatOptional getNumber(StyleValueHandle handle) const
Definition StyleValuePool.h:112
static constexpr uint16_t packInlineInteger(float value)
Definition StyleValuePool.h:176
void store(StyleValueHandle &handle, FloatOptional number)
Definition StyleValuePool.h:60
SmallValueBuffer< 4 > buffer_
Definition StyleValuePool.h:191
Definition Benchmark.cpp:19
Definition FloatOptional.h:15
constexpr bool isUndefined() const
Definition FloatOptional.h:32
constexpr float unwrap() const
Definition FloatOptional.h:24