#include <SkVx.h>
Definition at line 879 of file SkVx.h.
◆ ScaledDividerU32()
skvx::ScaledDividerU32::ScaledDividerU32 |
( |
uint32_t |
divisor | ) |
|
|
inlineexplicit |
Definition at line 881 of file SkVx.h.
882 : fDivisorFactor{(uint32_t)(
std::round((1.0 / divisor) * (1ull << 32)))}
883 , fHalf{(divisor + 1) >> 1} {
884 assert(divisor > 1);
885 }
static void round(SkPoint *p)
◆ divide()
Vec< 4, uint32_t > skvx::ScaledDividerU32::divide |
( |
const Vec< 4, uint32_t > & |
numerator | ) |
const |
|
inline |
Definition at line 887 of file SkVx.h.
887 {
888#if SKVX_USE_SIMD && defined(SK_ARM_HAS_NEON)
889 uint64x2_t hi = vmull_n_u32(vget_high_u32(to_vext(numerator)), fDivisorFactor);
890 uint64x2_t lo = vmull_n_u32(vget_low_u32(to_vext(numerator)), fDivisorFactor);
891
892 return to_vec<4, uint32_t>(vcombine_u32(vshrn_n_u64(lo,32), vshrn_n_u64(hi,32)));
893#else
894 return cast<uint32_t>((cast<uint64_t>(numerator) * fDivisorFactor) >> 32);
895#endif
896 }
◆ half()
uint32_t skvx::ScaledDividerU32::half |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file:
- third_party/skia/src/base/SkVx.h