Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SkSpriteBlitter Class Referenceabstract

#include <SkSpriteBlitter.h>

Inheritance diagram for SkSpriteBlitter:
SkBlitter SkRasterPipelineSpriteBlitter SkSpriteBlitter_Memcpy Sprite_D32_S32

Public Member Functions

 SkSpriteBlitter (const SkPixmap &source)
 
virtual bool setup (const SkPixmap &dst, int left, int top, const SkPaint &)
 
void blitH (int x, int y, int width) override
 Blit a horizontal run of one or more pixels.
 
void blitAntiH (int x, int y, const SkAlpha antialias[], const int16_t runs[]) override
 
void blitV (int x, int y, int height, SkAlpha alpha) override
 Blit a vertical run of pixels with a constant alpha value.
 
void blitMask (const SkMask &, const SkIRect &clip) override
 
void blitRect (int x, int y, int width, int height) override=0
 Blit a solid rectangle one or more pixels wide.
 
- Public Member Functions inherited from SkBlitter
virtual ~SkBlitter ()
 
virtual void blitAntiRect (int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha)
 
void blitFatAntiRect (const SkRect &rect)
 
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)
 
void blitRectRegion (const SkIRect &rect, const SkRegion &clip)
 
void blitRegion (const SkRegion &clip)
 

Static Public Member Functions

static SkSpriteBlitterChooseL32 (const SkPixmap &source, const SkPaint &, SkArenaAlloc *)
 
- Static Public Member Functions inherited from SkBlitter
static bool UseLegacyBlitter (const SkPixmap &, const SkPaint &, const SkMatrix &)
 
static SkBlitterChoose (const SkPixmap &dst, const SkMatrix &ctm, const SkPaint &paint, SkArenaAlloc *, bool drawCoverage, sk_sp< SkShader > clipShader, const SkSurfaceProps &props)
 
static SkBlitterChooseSprite (const SkPixmap &dst, const SkPaint &, const SkPixmap &src, int left, int top, SkArenaAlloc *, sk_sp< SkShader > clipShader)
 

Protected Attributes

SkPixmap fDst
 
const SkPixmap fSource
 
int fLeft
 
int fTop
 
const SkPaintfPaint
 
- Protected Attributes inherited from SkBlitter
SkAutoMalloc fBlitMemory
 

Detailed Description

Definition at line 20 of file SkSpriteBlitter.h.

Constructor & Destructor Documentation

◆ SkSpriteBlitter()

SkSpriteBlitter::SkSpriteBlitter ( const SkPixmap source)

Definition at line 39 of file SkBlitter_Sprite.cpp.

40 : fSource(source) {}
const SkPixmap fSource
SkBitmap source
Definition examples.cpp:28

Member Function Documentation

◆ blitAntiH()

void SkSpriteBlitter::blitAntiH ( int  x,
int  y,
const SkAlpha  antialias[],
const int16_t  runs[] 
)
overridevirtual

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.

Implements SkBlitter.

Definition at line 57 of file SkBlitter_Sprite.cpp.

57 {
58 SkDEBUGFAIL("how did we get here?");
59
60 // No fallback strategy.
61}
#define SkDEBUGFAIL(message)
Definition SkAssert.h:118

◆ blitH()

void SkSpriteBlitter::blitH ( int  x,
int  y,
int  width 
)
overridevirtual

Blit a horizontal run of one or more pixels.

Implements SkBlitter.

Definition at line 50 of file SkBlitter_Sprite.cpp.

50 {
51 SkDEBUGFAIL("how did we get here?");
52
53 // Fallback to blitRect.
54 this->blitRect(x, y, width, 1);
55}
void blitRect(int x, int y, int width, int height) override=0
Blit a solid rectangle one or more pixels wide.
double y
double x
int32_t width

◆ blitMask()

void SkSpriteBlitter::blitMask ( const SkMask mask,
const SkIRect clip 
)
overridevirtual

Blit a pattern of pixels defined by a rectangle-clipped mask; typically used for text.

Reimplemented from SkBlitter.

Definition at line 70 of file SkBlitter_Sprite.cpp.

70 {
71 SkDEBUGFAIL("how did we get here?");
72
73 // Fall back to superclass if the code gets here in release mode.
75}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
virtual void blitMask(const SkMask &, const SkIRect &clip)

◆ blitRect()

void SkSpriteBlitter::blitRect ( int  x,
int  y,
int  width,
int  height 
)
overridepure virtual

Blit a solid rectangle one or more pixels wide.

Reimplemented from SkBlitter.

Implemented in SkSpriteBlitter_Memcpy, SkRasterPipelineSpriteBlitter, and Sprite_D32_S32.

◆ blitV()

void SkSpriteBlitter::blitV ( int  x,
int  y,
int  height,
SkAlpha  alpha 
)
overridevirtual

Blit a vertical run of pixels with a constant alpha value.

Reimplemented from SkBlitter.

Definition at line 63 of file SkBlitter_Sprite.cpp.

63 {
64 SkDEBUGFAIL("how did we get here?");
65
66 // Fall back to superclass if the code gets here in release mode.
67 INHERITED::blitV(x, y, height, alpha);
68}
virtual void blitV(int x, int y, int height, SkAlpha alpha)
Blit a vertical run of pixels with a constant alpha value.
int32_t height

◆ ChooseL32()

SkSpriteBlitter * SkSpriteBlitter::ChooseL32 ( const SkPixmap source,
const SkPaint paint,
SkArenaAlloc allocator 
)
static

Definition at line 64 of file SkSpriteBlitter_ARGB32.cpp.

65 {
66 SkASSERT(allocator != nullptr);
67
68 if (paint.getColorFilter() != nullptr) {
69 return nullptr;
70 }
71 if (paint.getMaskFilter() != nullptr) {
72 return nullptr;
73 }
74 if (source.colorType() == kN32_SkColorType && paint.isSrcOver()) {
75 // this can handle alpha, but not xfermode
76 return allocator->make<Sprite_D32_S32>(source, paint.getAlpha());
77 }
78 return nullptr;
79}
#define SkASSERT(cond)
Definition SkAssert.h:116
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkColorType colorType() const
Definition SkBitmap.h:160
const Paint & paint

◆ setup()

bool SkSpriteBlitter::setup ( const SkPixmap dst,
int  left,
int  top,
const SkPaint paint 
)
virtual

Reimplemented in SkRasterPipelineSpriteBlitter.

Definition at line 42 of file SkBlitter_Sprite.cpp.

42 {
43 fDst = dst;
44 fLeft = left;
45 fTop = top;
46 fPaint = &paint;
47 return true;
48}
static bool left(const SkPoint &p0, const SkPoint &p1)
const SkPaint * fPaint
dst
Definition cp.py:12

Member Data Documentation

◆ fDst

SkPixmap SkSpriteBlitter::fDst
protected

Definition at line 38 of file SkSpriteBlitter.h.

◆ fLeft

int SkSpriteBlitter::fLeft
protected

Definition at line 40 of file SkSpriteBlitter.h.

◆ fPaint

const SkPaint* SkSpriteBlitter::fPaint
protected

Definition at line 41 of file SkSpriteBlitter.h.

◆ fSource

const SkPixmap SkSpriteBlitter::fSource
protected

Definition at line 39 of file SkSpriteBlitter.h.

◆ fTop

int SkSpriteBlitter::fTop
protected

Definition at line 40 of file SkSpriteBlitter.h.


The documentation for this class was generated from the following files: