Flutter Engine
The Flutter Engine
|
#include <SkBlitter.h>
Public Member Functions | |
virtual | ~SkBlitter () |
virtual void | blitH (int x, int y, int width)=0 |
Blit a horizontal run of one or more pixels. More... | |
virtual void | blitAntiH (int x, int y, const SkAlpha antialias[], const int16_t runs[])=0 |
virtual void | blitV (int x, int y, int height, SkAlpha alpha) |
Blit a vertical run of pixels with a constant alpha value. More... | |
virtual void | blitRect (int x, int y, int width, int height) |
Blit a solid rectangle one or more pixels wide. More... | |
virtual void | blitAntiRect (int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha) |
void | blitFatAntiRect (const SkRect &rect) |
virtual void | blitMask (const SkMask &, const SkIRect &clip) |
virtual void | blitAntiH2 (int x, int y, U8CPU a0, U8CPU a1) |
virtual void | blitAntiV2 (int x, int y, U8CPU a0, U8CPU a1) |
virtual bool | isNullBlitter () const |
virtual int | requestRowsPreserved () const |
virtual void * | allocBlitMemory (size_t sz) |
non-virtual helpers | |
void | blitRectRegion (const SkIRect &rect, const SkRegion &clip) |
void | blitRegion (const SkRegion &clip) |
Static Public Member Functions | |
static bool | UseLegacyBlitter (const SkPixmap &, const SkPaint &, const SkMatrix &) |
Factories | |
Return the correct blitter to use given the specified context. | |
static SkBlitter * | Choose (const SkPixmap &dst, const SkMatrix &ctm, const SkPaint &paint, SkArenaAlloc *, bool drawCoverage, sk_sp< SkShader > clipShader, const SkSurfaceProps &props) |
static SkBlitter * | ChooseSprite (const SkPixmap &dst, const SkPaint &, const SkPixmap &src, int left, int top, SkArenaAlloc *, sk_sp< SkShader > clipShader) |
Protected Attributes | |
SkAutoMalloc | fBlitMemory |
SkBlitter and its subclasses are responsible for actually writing pixels into memory. Besides efficiency, they handle clipping and antialiasing. A SkBlitter subclass contains all the context needed to generate pixels for the destination and how src/generated pixels map to the destination. The coordinates passed to the blitX calls are in destination pixel space.
Definition at line 38 of file SkBlitter.h.
|
virtual |
Definition at line 46 of file SkBlitter.cpp.
|
inlinevirtual |
This function allocates memory for the blitter that the blitter then owns. The memory can be used by the calling function at will, but it will be released when the blitter's destructor is called. This function returns nullptr if no persistent memory is needed by the blitter.
Reimplemented in SkRectClipBlitter, and SkRgnClipBlitter.
Definition at line 130 of file SkBlitter.h.
|
pure virtual |
Blit a horizontal run of antialiased pixels; runs[] is a sparse zero-terminated run-length encoding of spans of constant alpha values. The runs[] and antialias[] work together to represent long runs of pixels with the same alphas. The runs[] contains the number of pixels with the same alpha, and antialias[] contain the coverage value for that number of pixels. The runs[] (and antialias[]) are encoded in a clever way. The runs array is zero terminated, and has enough entries for each pixel plus one, in most cases some of the entries will not contain valid data. An entry in the runs array contains the number of pixels (np) that have the same alpha value. The next np value is found np entries away. For example, if runs[0] = 7, then the next valid entry will by at runs[7]. The runs array and antialias[] are coupled by index. So, if the np entry is at runs[45] = 12 then the alpha value can be found at antialias[45] = 0x88. This would mean to use an alpha value of 0x88 for the next 12 pixels starting at pixel 45.
Implemented in SkAAClip::Builder::Blitter, SkA8_Blitter, SkA8_Coverage_Blitter, SkARGB32_Blitter, SkARGB32_Black_Blitter, SkRgnBuilder, AdditiveBlitter, SkSpriteBlitter, TestBlitter, FakeBlitter, SkAAClipBlitter, SkNullBlitter, SkRectClipBlitter, SkRgnClipBlitter, SkARGB32_Shader_Blitter, SkRasterPipelineBlitter, and InverseBlitter.
Reimplemented in SkARGB32_Blitter, SkARGB32_Opaque_Blitter, SkARGB32_Black_Blitter, and SkRasterPipelineBlitter.
Definition at line 81 of file SkBlitter.h.
|
virtual |
Blit a rectangle with one alpha-blended column on the left, width (zero or more) opaque pixels, and one alpha-blended column on the right. The result will always be at least two pixels wide.
Default implementation doesn't check for easy optimizations such as alpha == 255; also uses blitV(), which some subclasses may not support.
Reimplemented in SkAAClip::Builder::Blitter, SkRectClipBlitter, SkRgnClipBlitter, AdditiveBlitter, and MaskAdditiveBlitter.
Definition at line 143 of file SkBlitter.cpp.
Reimplemented in SkARGB32_Blitter, SkARGB32_Opaque_Blitter, SkARGB32_Black_Blitter, and SkRasterPipelineBlitter.
Definition at line 94 of file SkBlitter.h.
void SkBlitter::blitFatAntiRect | ( | const SkRect & | rect | ) |
Definition at line 67 of file SkBlitter.cpp.
Blit a horizontal run of one or more pixels.
Implemented in SkRasterPipelineBlitter, SkAAClip::Builder::Blitter, SkAAClipBlitter, SkNullBlitter, SkRectClipBlitter, SkRgnClipBlitter, SkA8_Blitter, SkA8_Coverage_Blitter, SkARGB32_Blitter, SkARGB32_Shader_Blitter, SkRgnBuilder, AdditiveBlitter, InverseBlitter, SkSpriteBlitter, TestBlitter, and FakeBlitter.
Blit a pattern of pixels defined by a rectangle-clipped mask; typically used for text.
Reimplemented in SkA8_Blitter, SkA8_Coverage_Blitter, SkARGB32_Blitter, SkARGB32_Opaque_Blitter, SkARGB32_Shader_Blitter, SkAAClip::Builder::Blitter, SkAAClipBlitter, SkNullBlitter, SkRectClipBlitter, SkRgnClipBlitter, SkRasterPipelineBlitter, InverseBlitter, and SkSpriteBlitter.
Definition at line 201 of file SkBlitter.cpp.
Blit a solid rectangle one or more pixels wide.
Reimplemented in SkAAClip::Builder::Blitter, SkAAClipBlitter, SkNullBlitter, SkRectClipBlitter, SkRgnClipBlitter, SkA8_Blitter, SkA8_Coverage_Blitter, SkSpriteBlitter_Memcpy, SkRasterPipelineSpriteBlitter, SkARGB32_Blitter, SkARGB32_Shader_Blitter, SkRasterPipelineBlitter, AdditiveBlitter, MaskAdditiveBlitter, InverseBlitter, Sprite_D32_S32, and SkSpriteBlitter.
Definition at line 133 of file SkBlitter.cpp.
Definition at line 300 of file SkBlitter.cpp.
void SkBlitter::blitRegion | ( | const SkRegion & | clip | ) |
Definition at line 310 of file SkBlitter.cpp.
Blit a vertical run of pixels with a constant alpha value.
Reimplemented in SkAAClip::Builder::Blitter, SkAAClipBlitter, SkNullBlitter, SkRectClipBlitter, SkRgnClipBlitter, SkA8_Blitter, SkA8_Coverage_Blitter, SkARGB32_Blitter, SkARGB32_Shader_Blitter, SkRasterPipelineBlitter, AdditiveBlitter, MaskAdditiveBlitter, InverseBlitter, and SkSpriteBlitter.
Definition at line 119 of file SkBlitter.cpp.
|
static |
Definition at line 685 of file SkBlitter.cpp.
|
static |
Definition at line 195 of file SkBlitter_Sprite.cpp.
|
virtual |
Special method just to identify the null blitter, which is returned from Choose() if the request cannot be fulfilled. Default impl returns false.
Reimplemented in SkNullBlitter.
Definition at line 48 of file SkBlitter.cpp.
|
inlinevirtual |
Special methods for blitters that can blit more than one row at a time. This function returns the number of rows that this blitter could optimally process at a time. It is still required to support blitting one scanline at a time.
Reimplemented in SkRectClipBlitter, and SkRgnClipBlitter.
Definition at line 122 of file SkBlitter.h.
|
static |
Definition at line 648 of file SkBlitter.cpp.
|
protected |
Definition at line 163 of file SkBlitter.h.