Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkARGB32_Black_Blitter Class Reference

#include <SkCoreBlitters.h>

Inheritance diagram for SkARGB32_Black_Blitter:
SkARGB32_Opaque_Blitter SkARGB32_Blitter SkRasterBlitter SkBlitter

Public Member Functions

 SkARGB32_Black_Blitter (const SkPixmap &device, const SkPaint &paint)
 
void blitAntiH (int x, int y, const SkAlpha antialias[], const int16_t runs[]) override
 
void blitAntiH2 (int x, int y, U8CPU a0, U8CPU a1) override
 
void blitAntiV2 (int x, int y, U8CPU a0, U8CPU a1) override
 
- Public Member Functions inherited from SkARGB32_Opaque_Blitter
 SkARGB32_Opaque_Blitter (const SkPixmap &device, const SkPaint &paint)
 
void blitMask (const SkMask &, const SkIRect &) override
 
void blitAntiH2 (int x, int y, U8CPU a0, U8CPU a1) override
 
void blitAntiV2 (int x, int y, U8CPU a0, U8CPU a1) override
 
- Public Member Functions inherited from SkARGB32_Blitter
 SkARGB32_Blitter (const SkPixmap &device, const SkPaint &paint)
 
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 blitRect (int x, int y, int width, int height) override
 Blit a solid rectangle one or more pixels wide. More...
 
void blitMask (const SkMask &, const SkIRect &) override
 
void blitAntiH2 (int x, int y, U8CPU a0, U8CPU a1) override
 
void blitAntiV2 (int x, int y, U8CPU a0, U8CPU a1) override
 
- Public Member Functions inherited from SkRasterBlitter
 SkRasterBlitter (const SkPixmap &device)
 
- 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 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 SkARGB32_Blitter
SkColor fColor
 
SkPMColor fPMColor
 
- Protected Attributes inherited from SkRasterBlitter
const SkPixmap fDevice
 
- Protected Attributes inherited from SkBlitter
SkAutoMalloc fBlitMemory
 

Detailed Description

Definition at line 102 of file SkCoreBlitters.h.

Constructor & Destructor Documentation

◆ SkARGB32_Black_Blitter()

SkARGB32_Black_Blitter::SkARGB32_Black_Blitter ( const SkPixmap device,
const SkPaint paint 
)
inline

Definition at line 104 of file SkCoreBlitters.h.

105 : INHERITED(device, paint) {}
const Paint & paint
Definition: color_source.cc:38
VkDevice device
Definition: main.cc:53

Member Function Documentation

◆ blitAntiH()

void SkARGB32_Black_Blitter::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.

Reimplemented from SkARGB32_Blitter.

Definition at line 1669 of file SkBlitter_ARGB32.cpp.

1670 {
1671 uint32_t* device = fDevice.writable_addr32(x, y);
1673
1674 for (;;) {
1675 int count = runs[0];
1676 SkASSERT(count >= 0);
1677 if (count <= 0) {
1678 return;
1679 }
1680 unsigned aa = antialias[0];
1681 if (aa) {
1682 if (aa == 255) {
1683 SkOpts::memset32(device, black, count);
1684 } else {
1685 SkPMColor src = aa << SK_A32_SHIFT;
1686 unsigned dst_scale = 256 - aa;
1687 int n = count;
1688 do {
1689 --n;
1690 device[n] = src + SkAlphaMulQ(device[n], dst_scale);
1691 } while (n > 0);
1692 }
1693 }
1694 runs += count;
1695 antialias += count;
1696 device += count;
1697 }
1698}
int count
Definition: FontMgrTest.cpp:50
#define SkASSERT(cond)
Definition: SkAssert.h:116
static SK_ALWAYS_INLINE uint32_t SkAlphaMulQ(uint32_t c, unsigned scale)
Definition: SkColorPriv.h:142
#define SK_A32_MASK
Definition: SkColorPriv.h:45
uint32_t SkPMColor
Definition: SkColor.h:205
#define SK_A32_SHIFT
Definition: SkTypes.h:54
uint32_t * writable_addr32(int x, int y) const
Definition: SkPixmap.h:537
const SkPixmap fDevice
double y
double x
void(* memset32)(uint32_t[], uint32_t, int)

◆ blitAntiH2()

void SkARGB32_Black_Blitter::blitAntiH2 ( int  x,
int  y,
U8CPU  a0,
U8CPU  a1 
)
overridevirtual

Reimplemented from SkARGB32_Opaque_Blitter.

Definition at line 1700 of file SkBlitter_ARGB32.cpp.

1700 {
1701 uint32_t* device = fDevice.writable_addr32(x, y);
1702 SkDEBUGCODE((void)fDevice.writable_addr32(x + 1, y);)
1703
1704 device[0] = (a0 << SK_A32_SHIFT) + SkAlphaMulQ(device[0], 256 - a0);
1705 device[1] = (a1 << SK_A32_SHIFT) + SkAlphaMulQ(device[1], 256 - a1);
1706}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()

◆ blitAntiV2()

void SkARGB32_Black_Blitter::blitAntiV2 ( int  x,
int  y,
U8CPU  a0,
U8CPU  a1 
)
overridevirtual

Reimplemented from SkARGB32_Opaque_Blitter.

Definition at line 1708 of file SkBlitter_ARGB32.cpp.

1708 {
1709 uint32_t* device = fDevice.writable_addr32(x, y);
1710 SkDEBUGCODE((void)fDevice.writable_addr32(x, y + 1);)
1711
1712 device[0] = (a0 << SK_A32_SHIFT) + SkAlphaMulQ(device[0], 256 - a0);
1713 device = (uint32_t*)((char*)device + fDevice.rowBytes());
1714 device[0] = (a1 << SK_A32_SHIFT) + SkAlphaMulQ(device[0], 256 - a1);
1715}

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