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

#include <SkScanPriv.h>

Public Member Functions

 SkScanClipper (SkBlitter *blitter, const SkRegion *clip, const SkIRect &bounds, bool skipRejectTest=false, bool boundsPreClipped=false)
 
SkBlittergetBlitter () const
 
const SkIRectgetClipRect () const
 

Detailed Description

Definition at line 18 of file SkScanPriv.h.

Constructor & Destructor Documentation

◆ SkScanClipper()

SkScanClipper::SkScanClipper ( SkBlitter blitter,
const SkRegion clip,
const SkIRect ir,
bool  skipRejectTest = false,
bool  irPreClipped = false 
)

If the caller is drawing an inverse-fill path, then it pass true for skipRejectTest, so we don't abort drawing just because the src bounds (ir) is outside of the clip.

Definition at line 520 of file SkScan_Path.cpp.

521 {
522 fBlitter = nullptr; // null means blit nothing
523 fClipRect = nullptr;
524
525 if (clip) {
526 fClipRect = &clip->getBounds();
527 if (!skipRejectTest && !SkIRect::Intersects(*fClipRect, ir)) { // completely clipped out
528 return;
529 }
530
531 if (clip->isRect()) {
532 if (!irPreClipped && fClipRect->contains(ir)) {
533#ifdef SK_DEBUG
534 fRectClipCheckBlitter.init(blitter, *fClipRect);
535 blitter = &fRectClipCheckBlitter;
536#endif
537 fClipRect = nullptr;
538 } else {
539 // only need a wrapper blitter if we're horizontally clipped
540 if (irPreClipped ||
541 fClipRect->fLeft > ir.fLeft || fClipRect->fRight < ir.fRight) {
542 fRectBlitter.init(blitter, *fClipRect);
543 blitter = &fRectBlitter;
544 } else {
545#ifdef SK_DEBUG
546 fRectClipCheckBlitter.init(blitter, *fClipRect);
547 blitter = &fRectClipCheckBlitter;
548#endif
549 }
550 }
551 } else {
552 fRgnBlitter.init(blitter, clip);
553 blitter = &fRgnBlitter;
554 }
555 }
556 fBlitter = blitter;
557}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
const SkRect & getBounds() const
Definition: SkPath.cpp:430
bool isRect(SkRect *rect, bool *isClosed=nullptr, SkPathDirection *direction=nullptr) const
Definition: SkPath.cpp:516
void init(SkBlitter *blitter, const SkIRect &clipRect)
Definition: SkBlitter.h:184
void init(SkBlitter *blitter, const SkRegion *clipRgn)
Definition: SkBlitter.h:217
static bool Intersects(const SkIRect &a, const SkIRect &b)
Definition: SkRect.h:535
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:33
bool contains(int32_t x, int32_t y) const
Definition: SkRect.h:463
int32_t fRight
larger x-axis bounds
Definition: SkRect.h:35

Member Function Documentation

◆ getBlitter()

SkBlitter * SkScanClipper::getBlitter ( ) const
inline

Definition at line 23 of file SkScanPriv.h.

23{ return fBlitter; }

◆ getClipRect()

const SkIRect * SkScanClipper::getClipRect ( ) const
inline

Definition at line 24 of file SkScanPriv.h.

24{ return fClipRect; }

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