Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
Sprite_D32_S32 Class Reference
Inheritance diagram for Sprite_D32_S32:
SkSpriteBlitter SkBlitter

Public Member Functions

 Sprite_D32_S32 (const SkPixmap &src, U8CPU alpha)
 
void blitRect (int x, int y, int width, int height) override
 Blit a solid rectangle one or more pixels wide. More...
 
- Public Member Functions inherited from SkSpriteBlitter
 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. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from SkBlitter
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)
 
void blitRectRegion (const SkIRect &rect, const SkRegion &clip)
 
void blitRegion (const SkRegion &clip)
 

Additional Inherited Members

- Static Public Member Functions inherited from SkSpriteBlitter
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 inherited from SkSpriteBlitter
SkPixmap fDst
 
const SkPixmap fSource
 
int fLeft
 
int fTop
 
const SkPaintfPaint
 
- Protected Attributes inherited from SkBlitter
SkAutoMalloc fBlitMemory
 

Detailed Description

Definition at line 22 of file SkSpriteBlitter_ARGB32.cpp.

Constructor & Destructor Documentation

◆ Sprite_D32_S32()

Sprite_D32_S32::Sprite_D32_S32 ( const SkPixmap src,
U8CPU  alpha 
)
inline

Definition at line 24 of file SkSpriteBlitter_ARGB32.cpp.

24 : INHERITED(src) {
25 SkASSERT(src.colorType() == kN32_SkColorType);
26
27 unsigned flags32 = 0;
28 if (255 != alpha) {
30 }
31 if (!src.isOpaque()) {
33 }
34
35 fProc32 = SkBlitRow::Factory32(flags32);
36 fAlpha = alpha;
37 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static Proc32 Factory32(unsigned flags32)
@ kSrcPixelAlpha_Flag32
Definition: SkBlitRow.h:18
@ kGlobalAlpha_Flag32
Definition: SkBlitRow.h:17

Member Function Documentation

◆ blitRect()

void Sprite_D32_S32::blitRect ( int  x,
int  y,
int  width,
int  height 
)
inlineoverridevirtual

Blit a solid rectangle one or more pixels wide.

Implements SkSpriteBlitter.

Definition at line 39 of file SkSpriteBlitter_ARGB32.cpp.

39 {
40 SkASSERT(width > 0 && height > 0);
41 uint32_t* SK_RESTRICT dst = fDst.writable_addr32(x, y);
42 const uint32_t* SK_RESTRICT src = fSource.addr32(x - fLeft, y - fTop);
43 size_t dstRB = fDst.rowBytes();
44 size_t srcRB = fSource.rowBytes();
45 SkBlitRow::Proc32 proc = fProc32;
46 U8CPU alpha = fAlpha;
47
48 do {
49 proc(dst, src, width, alpha);
50 dst = (uint32_t* SK_RESTRICT)((char*)dst + dstRB);
51 src = (const uint32_t* SK_RESTRICT)((const char*)src + srcRB);
52 } while (--height != 0);
53 }
unsigned U8CPU
Definition: SkCPUTypes.h:18
#define SK_RESTRICT
Definition: SkFeatures.h:42
void(* Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8CPU alpha)
Definition: SkBlitRow.h:27
const uint32_t * addr32() const
Definition: SkPixmap.h:352
size_t rowBytes() const
Definition: SkPixmap.h:145
uint32_t * writable_addr32(int x, int y) const
Definition: SkPixmap.h:537
const SkPixmap fSource
double y
double x
dst
Definition: cp.py:12
int32_t height
int32_t width

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