3 * Copyright 2006 The Android Open Source Project
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkAntiRun_DEFINED
11 #define SkAntiRun_DEFINED
13 #include "SkBlitter.h"
21 SkASSERT(fRuns[0] > 0);
22 return fAlpha[0] == 0 && fRuns[fRuns[0]] == 0;
25 void reset(int width);
28 * Returns the offsetX value that should be passed on the next call,
29 * assuming we're on the same scanline. If the caller is switching
30 * scanlines, then offsetX should be 0 when this is called.
32 int add(int x, U8CPU startAlpha, int middleCount, U8CPU stopAlpha,
33 U8CPU maxValue, int offsetX);
35 SkDEBUGCODE(void assertValid(int y, int maxStep) const;)
36 SkDEBUGCODE(void dump() const;)
38 static void Break(int16_t runs[], uint8_t alpha[], int x, int count);
40 static void BreakAt(int16_t runs[], uint8_t alpha[], int x) {
48 runs[x] = SkToS16(n - x);
58 SkDEBUGCODE(int fWidth;)
59 SkDEBUGCODE(void validate() const;)