Flutter Engine
The Flutter Engine
|
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkCPUTypes.h"
#include "include/private/base/SkTemplates.h"
#include <cstddef>
#include <cstdint>
Go to the source code of this file.
Macros | |
#define | SkExtractSign(n) ((int32_t)(n) >> 31) |
Functions | |
int32_t | SkSqrtBits (int32_t value, int bitBias) |
static int32_t | SkSqrt32 (int32_t n) |
static int | SkClampPos (int value) |
template<typename In , typename Out > | |
void | SkTDivMod (In numer, In denom, Out *div, Out *mod) |
static int32_t | SkApplySign (int32_t n, int32_t sign) |
static int32_t | SkCopySign32 (int32_t x, int32_t y) |
static unsigned | SkClampUMax (unsigned value, unsigned max) |
static size_t | sk_negate_to_size_t (int32_t value) |
static U8CPU | SkMulDiv255Trunc (U8CPU a, U8CPU b) |
static U8CPU | SkMulDiv255Ceiling (U8CPU a, U8CPU b) |
static unsigned | SkDiv255Round (unsigned prod) |
static uint32_t | SkBSwap32 (uint32_t v) |
int | SkPopCount_portable (uint32_t n) |
static int | SkPopCount (uint32_t n) |
int | SkNthSet (uint32_t target, int n) |
constexpr int | SkCLZ_portable (uint32_t x) |
Returns the number of leading zero bits (0...32) More... | |
static int | SkCLZ (uint32_t mask) |
constexpr int | SkCTZ_portable (uint32_t x) |
Returns the number of trailing zero bits (0...32) More... | |
static int | SkCTZ (uint32_t mask) |
static int | SkNextLog2 (uint32_t value) |
constexpr int | SkNextLog2_portable (uint32_t value) |
static int | SkPrevLog2 (uint32_t value) |
constexpr int | SkPrevLog2_portable (uint32_t value) |
static int | SkNextPow2 (int value) |
constexpr int | SkNextPow2_portable (int value) |
static int | SkPrevPow2 (int value) |
constexpr int | SkPrevPow2_portable (int value) |
static uint32_t | GrNextPow2 (uint32_t n) |
static size_t | GrNextSizePow2 (size_t n) |
template<typename T > | |
static bool | SkFitsInFixed (T x) |
#define SkExtractSign | ( | n | ) | ((int32_t)(n) >> 31) |
Returns -1 if n < 0, else returns 0
Definition at line 45 of file SkMathPriv.h.
|
inlinestatic |
|
inlinestatic |
Returns the next power of 2 >= n or n if the next power of 2 can't be represented by size_t.
Definition at line 309 of file SkMathPriv.h.
|
inlinestatic |
Definition at line 76 of file SkMathPriv.h.
|
inlinestatic |
If sign == -1, returns -n, else sign must be 0, and returns n. Typically used in conjunction with SkExtractSign().
Definition at line 50 of file SkMathPriv.h.
|
inlinestatic |
Swap byte order of a 4-byte value, e.g. 0xaarrggbb -> 0xbbggrraa.
Definition at line 123 of file SkMathPriv.h.
Returns (value < 0 ? 0 : value) efficiently (i.e. no compares or branches)
Definition at line 30 of file SkMathPriv.h.
|
inlinestatic |
Given a positive value and a positive max, return the value pinned against max. Note: only works as long as max - value doesn't wrap around
Definition at line 65 of file SkMathPriv.h.
|
inlinestatic |
Definition at line 186 of file SkMathPriv.h.
|
constexpr |
Returns the number of leading zero bits (0...32)
Definition at line 149 of file SkMathPriv.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 224 of file SkMathPriv.h.
|
constexpr |
Returns the number of trailing zero bits (0...32)
Definition at line 193 of file SkMathPriv.h.
|
inlinestatic |
Just the rounding step in SkDiv255Round: round(value / 255)
Definition at line 111 of file SkMathPriv.h.
Definition at line 329 of file SkMathPriv.h.
Return (a*b)/255, taking the ceiling of any fractional bits. Only valid if both a and b are 0..255. The expected result equals (a * b + 254) / 255.
Definition at line 102 of file SkMathPriv.h.
|
inlinestatic |
Returns the log2 of the specified value, were that value to be rounded up to the next power of 2. It is undefined to pass 0. Examples: SkNextLog2(1) -> 0 SkNextLog2(2) -> 1 SkNextLog2(3) -> 2 SkNextLog2(4) -> 2 SkNextLog2(5) -> 3
Definition at line 238 of file SkMathPriv.h.
|
constexpr |
Definition at line 243 of file SkMathPriv.h.
Returns the smallest power-of-2 that is >= the specified value. If value is already a power of 2, then it is returned unchanged. It is undefined if value is <= 0.
Definition at line 272 of file SkMathPriv.h.
Definition at line 277 of file SkMathPriv.h.
Definition at line 53 of file SkMathPriv.cpp.
|
inlinestatic |
Definition at line 136 of file SkMathPriv.h.
int SkPopCount_portable | ( | uint32_t | n | ) |
Definition at line 42 of file SkMathPriv.cpp.
|
inlinestatic |
Returns the log2 of the specified value, were that value to be rounded down to the previous power of 2. It is undefined to pass 0. Examples: SkPrevLog2(1) -> 0 SkPrevLog2(2) -> 1 SkPrevLog2(3) -> 1 SkPrevLog2(4) -> 2 SkPrevLog2(5) -> 2
Definition at line 257 of file SkMathPriv.h.
|
constexpr |
Definition at line 262 of file SkMathPriv.h.
Returns the largest power-of-2 that is <= the specified value. If value is already a power of 2, then it is returned unchanged. It is undefined if value is <= 0.
Definition at line 287 of file SkMathPriv.h.
Definition at line 292 of file SkMathPriv.h.
|
inlinestatic |
Return the integer square root of n, treated as a SkFixed (16.16)
Definition at line 25 of file SkMathPriv.h.
int32_t SkSqrtBits | ( | int32_t | value, |
int | bitBias | ||
) |
Return the integer square root of value, with a bias of bitBias
Definition at line 18 of file SkMathPriv.cpp.
|
inline |
Stores numer/denom and numerdenom into div and mod respectively.
Definition at line 38 of file SkMathPriv.h.