Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
 
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 blitRect (int x, int y, int width, int height) override
 Blit a solid rectangle one or more pixels wide.
 
- Public Member Functions inherited from SkRasterBlitter
 SkRasterBlitter (const SkPixmap &device)
 
- 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 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
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.

Implements SkBlitter.

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
#define SkASSERT(cond)
Definition SkAssert.h:116
static SK_ALWAYS_INLINE uint32_t SkAlphaMulQ(uint32_t c, unsigned scale)
#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 SkBlitter.

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}
#define SkDEBUGCODE(...)
Definition SkDebug.h:23

◆ blitAntiV2()

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

Reimplemented from SkBlitter.

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}
size_t rowBytes() const
Definition SkPixmap.h:145

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