1 /* 2 * Copyright 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.compose.ui.geometry 18 19 // Masks everything but the sign bit 20 @PublishedApi internal const val DualUnsignedFloatMask = 0x7fffffff_7fffffffL 21 22 // Any value greater than this is a NaN 23 @PublishedApi internal const val FloatInfinityBase = 0x7f800000 24 25 // Same as above, but for floats packed in a Long 26 @PublishedApi internal const val DualFloatInfinityBase = 0x7f800000_7f800000L 27 28 // Same as Offset/Size.Unspecified.packedValue, but avoids a getstatic 29 @PublishedApi internal const val UnspecifiedPackedFloats = 0x7fc00000_7fc00000L // NaN_NaN 30 31 // 0x80000000_80000000UL.toLong() but expressed as a const value 32 // Mask for the sign bit of the two floats packed in a long 33 @PublishedApi internal const val DualFloatSignBit = -0x7fffffff_80000000L 34 35 // Set the highest bit of each 32 bit chunk in a 64 bit word 36 @PublishedApi internal const val Uint64High32 = -0x7fffffff_80000000L 37 38 // Set the lowest bit of each 32 bit chunk in a 64 bit word 39 @PublishedApi internal const val Uint64Low32 = 0x00000001_00000001L 40 41 // Encodes the first valid NaN in each of the 32 bit chunk of a 64 bit word 42 @PublishedApi internal const val DualFirstNaN = 0x7f800001_7f800001L 43 44 // Set all the significand bits for each 32 bit chunk in a 64 bit word 45 @PublishedApi internal const val DualLoadedSignificand = 0x007fffff_007fffffL 46