15template <
typename T>
static constexpr T SkAlign2(
T x) {
return (
x + 1) >> 1 << 1; }
16template <
typename T>
static constexpr T SkAlign4(
T x) {
return (
x + 3) >> 2 << 2; }
17template <
typename T>
static constexpr T SkAlign8(
T x) {
return (
x + 7) >> 3 << 3; }
19template <
typename T>
static constexpr bool SkIsAlign2(
T x) {
return 0 == (
x & 1); }
20template <
typename T>
static constexpr bool SkIsAlign4(
T x) {
return 0 == (
x & 3); }
21template <
typename T>
static constexpr bool SkIsAlign8(
T x) {
return 0 == (
x & 7); }
33static inline constexpr size_t SkAlignTo(
size_t x,
size_t alignment) {
35 SkASSERT(alignment && (alignment & (alignment - 1)) == 0);
36 return (
x + alignment - 1) & ~(alignment - 1);
static constexpr bool SkIsAlign2(T x)
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
static constexpr bool SkIsAlign8(T x)
static constexpr bool SkIsAlign4(T x)
static constexpr bool SkIsAlignPtr(T x)
static constexpr T SkAlign2(T x)
static constexpr T SkAlign4(T x)
static constexpr T SkAlign8(T x)
static constexpr T SkAlignPtr(T x)