Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
SkSpriteBlitter_Memcpy Class Referencefinal
Inheritance diagram for SkSpriteBlitter_Memcpy:
SkSpriteBlitter SkBlitter

Public Member Functions

 SkSpriteBlitter_Memcpy (const SkPixmap &src)
 
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)
 

Static Public Member Functions

static bool Supports (const SkPixmap &dst, const SkPixmap &src, const SkPaint &paint)
 
- 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)
 

Additional Inherited Members

- 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 79 of file SkBlitter_Sprite.cpp.

Constructor & Destructor Documentation

◆ SkSpriteBlitter_Memcpy()

SkSpriteBlitter_Memcpy::SkSpriteBlitter_Memcpy ( const SkPixmap src)
inline

Definition at line 98 of file SkBlitter_Sprite.cpp.

99 : INHERITED(src) {}

Member Function Documentation

◆ blitRect()

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

Blit a solid rectangle one or more pixels wide.

Implements SkSpriteBlitter.

Definition at line 101 of file SkBlitter_Sprite.cpp.

101 {
103 SkASSERT(width > 0 && height > 0);
104
105 char* dst = (char*)fDst.writable_addr(x, y);
106 const char* src = (const char*)fSource.addr(x - fLeft, y - fTop);
107 const size_t dstRB = fDst.rowBytes();
108 const size_t srcRB = fSource.rowBytes();
109 const size_t bytesToCopy = width << fSource.shiftPerPixel();
110
111 while (height --> 0) {
112 memcpy(dst, src, bytesToCopy);
113 dst += dstRB;
114 src += srcRB;
115 }
116 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
size_t rowBytes() const
Definition: SkPixmap.h:145
SkColorType colorType() const
Definition: SkPixmap.h:173
void * writable_addr() const
Definition: SkPixmap.h:483
const void * addr() const
Definition: SkPixmap.h:153
int shiftPerPixel() const
Definition: SkPixmap.h:221
const SkPixmap fSource
double y
double x
dst
Definition: cp.py:12
int32_t height
int32_t width

◆ Supports()

static bool SkSpriteBlitter_Memcpy::Supports ( const SkPixmap dst,
const SkPixmap src,
const SkPaint paint 
)
inlinestatic

Definition at line 81 of file SkBlitter_Sprite.cpp.

81 {
82 // the caller has already inspected the colorspace on src and dst
84
85 if (dst.colorType() != src.colorType()) {
86 return false;
87 }
88 if (paint.getMaskFilter() || paint.getColorFilter() || paint.getImageFilter()) {
89 return false;
90 }
91 if (0xFF != paint.getAlpha()) {
92 return false;
93 }
94 const auto mode = paint.asBlendMode();
95 return mode == SkBlendMode::kSrc || (mode == SkBlendMode::kSrcOver && src.isOpaque());
96 }
@ kSrcOver
r = s + (1-sa)*d
const Paint & paint
Definition: color_source.cc:38
FlutterSemanticsFlag flags
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

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