Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SafeRLEAdditiveBlitter Class Reference
Inheritance diagram for SafeRLEAdditiveBlitter:
RunBasedAdditiveBlitter AdditiveBlitter SkBlitter

Public Member Functions

 SafeRLEAdditiveBlitter (SkBlitter *realBlitter, const SkIRect &ir, const SkIRect &clipBounds, bool isInverse)
 
void blitAntiH (int x, int y, const SkAlpha antialias[], int len) override
 
void blitAntiH (int x, int y, const SkAlpha alpha) override
 
void blitAntiH (int x, int y, int width, const SkAlpha alpha) override
 
- Public Member Functions inherited from RunBasedAdditiveBlitter
 RunBasedAdditiveBlitter (SkBlitter *realBlitter, const SkIRect &ir, const SkIRect &clipBounds, bool isInverse)
 
 ~RunBasedAdditiveBlitter () override
 
SkBlittergetRealBlitter (bool forceRealBlitter) override
 
void blitAntiH (int x, int y, const SkAlpha antialias[], int len) override
 
void blitAntiH (int x, int y, const SkAlpha alpha) override
 
void blitAntiH (int x, int y, int width, const SkAlpha alpha) override
 
int getWidth () override
 
void flush_if_y_changed (SkFixed y, SkFixed nextY) override
 
- Public Member Functions inherited from AdditiveBlitter
 ~AdditiveBlitter () override
 
virtual SkBlittergetRealBlitter (bool forceRealBlitter=false)=0
 
virtual void blitAntiH (int x, int y, const SkAlpha antialias[], int len)=0
 
virtual void blitAntiH (int x, int y, const SkAlpha alpha)=0
 
virtual void blitAntiH (int x, int y, int width, const SkAlpha alpha)=0
 
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 blitH (int x, int y, int width) override
 Blit a horizontal run of one or more pixels. More...
 
void blitRect (int x, int y, int width, int height) override
 Blit a solid rectangle one or more pixels wide. More...
 
void blitAntiRect (int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha) override
 
virtual int getWidth ()=0
 
virtual void flush_if_y_changed (SkFixed y, SkFixed nextY)=0
 
- 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 Member Functions inherited from RunBasedAdditiveBlitter
bool check (int x, int width) const
 
int getRunsSz () const
 
void advanceRuns ()
 
SkAlpha snapAlpha (SkAlpha alpha)
 
void flush ()
 
void checkY (int y)
 
- Protected Attributes inherited from RunBasedAdditiveBlitter
SkBlitterfRealBlitter
 
int fCurrY
 
int fWidth
 
int fLeft
 
int fTop
 
int fRunsToBuffer
 
void * fRunsBuffer
 
int fCurrentRun
 
SkAlphaRuns fRuns
 
int fOffsetX
 
- Protected Attributes inherited from SkBlitter
SkAutoMalloc fBlitMemory
 

Detailed Description

Definition at line 460 of file SkScan_AAAPath.cpp.

Constructor & Destructor Documentation

◆ SafeRLEAdditiveBlitter()

SafeRLEAdditiveBlitter::SafeRLEAdditiveBlitter ( SkBlitter realBlitter,
const SkIRect ir,
const SkIRect clipBounds,
bool  isInverse 
)
inline

Definition at line 462 of file SkScan_AAAPath.cpp.

466 : RunBasedAdditiveBlitter(realBlitter, ir, clipBounds, isInverse) {}
RunBasedAdditiveBlitter(SkBlitter *realBlitter, const SkIRect &ir, const SkIRect &clipBounds, bool isInverse)

Member Function Documentation

◆ blitAntiH() [1/3]

void SafeRLEAdditiveBlitter::blitAntiH ( int  x,
int  y,
const SkAlpha  alpha 
)
overridevirtual

Reimplemented from RunBasedAdditiveBlitter.

Definition at line 502 of file SkScan_AAAPath.cpp.

502 {
503 checkY(y);
504 x -= fLeft;
505
506 if (x < fOffsetX) {
507 fOffsetX = 0;
508 }
509
510 if (check(x, 1)) {
511 // Break the run
512 fOffsetX = fRuns.add(x, 0, 1, 0, 0, fOffsetX);
513 safely_add_alpha(&fRuns.fAlpha[x], alpha);
514 }
515}
static void safely_add_alpha(SkAlpha *alpha, SkAlpha delta)
bool check(int x, int width) const
uint8_t * fAlpha
Definition: SkAlphaRuns.h:27
SK_ALWAYS_INLINE int add(int x, U8CPU startAlpha, int middleCount, U8CPU stopAlpha, U8CPU maxValue, int offsetX)
Definition: SkAlphaRuns.h:58
double y
double x

◆ blitAntiH() [2/3]

void SafeRLEAdditiveBlitter::blitAntiH ( int  x,
int  y,
const SkAlpha  antialias[],
int  len 
)
overridevirtual

Reimplemented from RunBasedAdditiveBlitter.

Definition at line 473 of file SkScan_AAAPath.cpp.

473 {
474 checkY(y);
475 x -= fLeft;
476
477 if (x < 0) {
478 len += x;
479 antialias -= x;
480 x = 0;
481 }
482 len = std::min(len, fWidth - x);
483 SkASSERT(check(x, len));
484
485 if (x < fOffsetX) {
486 fOffsetX = 0;
487 }
488
489 fOffsetX = fRuns.add(x, 0, len, 0, 0, fOffsetX); // Break the run
490 for (int i = 0; i < len; i += fRuns.fRuns[x + i]) {
491 for (int j = 1; j < fRuns.fRuns[x + i]; j++) {
492 fRuns.fRuns[x + i + j] = 1;
493 fRuns.fAlpha[x + i + j] = fRuns.fAlpha[x + i];
494 }
495 fRuns.fRuns[x + i] = 1;
496 }
497 for (int i = 0; i < len; ++i) {
498 safely_add_alpha(&fRuns.fAlpha[x + i], antialias[i]);
499 }
500}
#define SkASSERT(cond)
Definition: SkAssert.h:116
int16_t * fRuns
Definition: SkAlphaRuns.h:26
static float min(float r, float g, float b)
Definition: hsl.cpp:48

◆ blitAntiH() [3/3]

void SafeRLEAdditiveBlitter::blitAntiH ( int  x,
int  y,
int  width,
const SkAlpha  alpha 
)
overridevirtual

Reimplemented from RunBasedAdditiveBlitter.

Definition at line 517 of file SkScan_AAAPath.cpp.

517 {
518 checkY(y);
519 x -= fLeft;
520
521 if (x < fOffsetX) {
522 fOffsetX = 0;
523 }
524
525 if (check(x, width)) {
526 // Break the run
527 fOffsetX = fRuns.add(x, 0, width, 0, 0, fOffsetX);
528 for (int i = x; i < x + width; i += fRuns.fRuns[i]) {
529 safely_add_alpha(&fRuns.fAlpha[i], alpha);
530 }
531 }
532}
int32_t width

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