 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
18 static inline int64_t
sk_64_mul(int64_t a, int64_t b) {
28 template <
typename T> constexpr
inline bool SkIsPow2(T value) {
29 return (value & (value - 1)) == 0;
42 unsigned prod = a*b + (1 << (shift - 1));
43 return (prod + (prod >> shift)) >> shift;
static unsigned SkMul16ShiftRound(U16CPU a, U16CPU b, int shift)
Return a*b/((1 << shift) - 1), rounding any fractional bits.
Definition: SkMath.h:38
#define SkASSERT(cond)
Definition: SkTypes.h:460
constexpr bool SkIsPow2(T value)
Returns true if value is a power of 2.
Definition: SkMath.h:28
static int64_t sk_64_mul(int64_t a, int64_t b)
Definition: SkMath.h:18
unsigned U16CPU
Fast type for unsigned 16 bits.
Definition: SkTypes.h:493
static U8CPU SkMulDiv255Round(U16CPU a, U16CPU b)
Return a*b/255, rounding any fractional bits.
Definition: SkMath.h:50
unsigned U8CPU
Fast type for unsigned 8 bits.
Definition: SkTypes.h:488