Go to the source code of this file.
◆ sk_64_mul()
static int64_t sk_64_mul |
( |
int64_t |
a, |
|
|
int64_t |
b |
|
) |
| |
|
inlinestatic |
◆ SkIsPow2()
constexpr bool SkIsPow2 |
( |
T |
value | ) |
|
|
inlineconstexpr |
Returns true if value is a power of 2. Does not explicitly check for value <= 0.
Definition at line 51 of file SkMath.h.
◆ SkLeftShift() [1/2]
static constexpr int32_t SkLeftShift |
( |
int32_t |
value, |
|
|
int32_t |
shift |
|
) |
| |
|
inlinestaticconstexpr |
Definition at line 37 of file SkMath.h.
37 {
38 return (int32_t) ((uint32_t)
value << shift);
39}
◆ SkLeftShift() [2/2]
static constexpr int64_t SkLeftShift |
( |
int64_t |
value, |
|
|
int32_t |
shift |
|
) |
| |
|
inlinestaticconstexpr |
Definition at line 41 of file SkMath.h.
41 {
42 return (int64_t) ((uint64_t)
value << shift);
43}
◆ SkMul16ShiftRound()
Return a*b/((1 << shift) - 1), rounding any fractional bits. Only valid if a and b are unsigned and <= 32767 and shift is > 0 and <= 8
Definition at line 61 of file SkMath.h.
61 {
65 unsigned prod =
a*
b + (1 << (shift - 1));
66 return (prod + (prod >> shift)) >> shift;
67}
◆ SkMulDiv255Round()
Return a*b/255, rounding any fractional bits. Only valid if a and b are unsigned and <= 32767.
Definition at line 73 of file SkMath.h.
73 {
75}
static unsigned SkMul16ShiftRound(U16CPU a, U16CPU b, int shift)
◆ SK_MaxS16
constexpr int16_t SK_MaxS16 = INT16_MAX |
|
staticconstexpr |
◆ SK_MaxS32
constexpr int32_t SK_MaxS32 = INT32_MAX |
|
staticconstexpr |
◆ SK_MaxS64
constexpr int64_t SK_MaxS64 = INT64_MAX |
|
staticconstexpr |
◆ SK_MinS16
◆ SK_MinS32
◆ SK_MinS64
◆ SK_NaN32
constexpr int32_t SK_NaN32 = INT32_MIN |
|
staticconstexpr |