Flutter Engine
The Flutter Engine
|
#include <SkAlphaRuns.h>
Public Member Functions | |
bool | empty () const |
void | reset (int width) |
Reinitialize for a new scanline. More... | |
SK_ALWAYS_INLINE int | add (int x, U8CPU startAlpha, int middleCount, U8CPU stopAlpha, U8CPU maxValue, int offsetX) |
SkDEBUGCODE (void assertValid(int y, int maxStep) const ;) SkDEBUGCODE(void dump() const | |
Static Public Member Functions | |
static SkAlpha | CatchOverflow (int alpha) |
static void | Break (int16_t runs[], uint8_t alpha[], int x, int count) |
static void | BreakAt (int16_t runs[], uint8_t alpha[], int x) |
Public Attributes | |
int16_t * | fRuns |
uint8_t * | fAlpha |
Sparse array of run-length-encoded alpha (supersampling coverage) values. Sparseness allows us to independently compose several paths into the same SkAlphaRuns buffer.
Definition at line 24 of file SkAlphaRuns.h.
|
inline |
Insert into the buffer a run starting at (x-offsetX): if startAlpha > 0 one pixel with value += startAlpha, max 255 if middleCount > 0 middleCount pixels with value += maxValue if stopAlpha > 0 one pixel with value += stopAlpha Returns the offsetX value that should be passed on the next call, assuming we're on the same scanline. If the caller is switching scanlines, then offsetX should be 0 when this is called.
Definition at line 58 of file SkAlphaRuns.h.
Break the runs in the buffer at offsets x and x+count, properly updating the runs to the right and left. i.e. from the state AAAABBBB, run-length encoded as A4B4, Break(..., 2, 5) would produce AAAABBBB rle as A2A2B3B1. Allows add() to sum another run to some of the new sub-runs. i.e. adding ..CCCCC. would produce AADDEEEB, rle as A2D2E3B1.
Definition at line 126 of file SkAlphaRuns.h.
|
inlinestatic |
Cut (at offset x in the buffer) a run into two shorter runs with matching alpha values. Used by the RectClipBlitter to trim a RLE encoding to match the clipping rectangle.
Definition at line 179 of file SkAlphaRuns.h.
Definition at line 30 of file SkAlphaRuns.h.
|
inline |
void SkAlphaRuns::reset | ( | int | width | ) |
Reinitialize for a new scanline.
Definition at line 11 of file SkAlphaRuns.cpp.
uint8_t* SkAlphaRuns::fAlpha |
Definition at line 27 of file SkAlphaRuns.h.
int16_t* SkAlphaRuns::fRuns |
Definition at line 26 of file SkAlphaRuns.h.