8#ifndef SkAlphaRuns_DEFINED
9#define SkAlphaRuns_DEFINED
31 SkASSERT(alpha >= 0 && alpha <= 256);
32 return alpha - (alpha >> 8);
61 SkASSERT(
x >= 0 &&
x + (startAlpha != 0) + middleCount + (stopAlpha != 0) <= fWidth);
67 uint8_t* lastAlpha = alpha;
77 unsigned tmp = alpha[
x] + startAlpha;
79 alpha[
x] =
SkToU8(tmp - (tmp >> 8));
99 }
while (middleCount > 0);
107 alpha[0] =
SkToU8(alpha[0] + stopAlpha);
126 static void Break(int16_t runs[], uint8_t alpha[],
int x,
int count) {
132 int16_t* next_runs = runs +
x;
133 uint8_t* next_alpha = alpha +
x;
179 static void BreakAt(int16_t runs[], uint8_t alpha[],
int x) {
constexpr int32_t SkToS32(S x)
constexpr uint8_t SkToU8(S x)
constexpr int16_t SkToS16(S x)
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
static void Break(int16_t runs[], uint8_t alpha[], int x, int count)
void reset(int width)
Reinitialize for a new scanline.
SkDEBUGCODE(void assertValid(int y, int maxStep) const ;) SkDEBUGCODE(void dump() const
SK_ALWAYS_INLINE int add(int x, U8CPU startAlpha, int middleCount, U8CPU stopAlpha, U8CPU maxValue, int offsetX)
static void BreakAt(int16_t runs[], uint8_t alpha[], int x)
static SkAlpha CatchOverflow(int alpha)