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

#include <SkBlitter.h>

Public Member Functions

SkBlitterapply (SkBlitter *blitter, const SkRegion *clip, const SkIRect *bounds=nullptr)
 

Detailed Description

Factory to set up the appropriate most-efficient wrapper blitter to apply a clip. Returns a pointer to a member, so lifetime must be managed carefully.

Definition at line 282 of file SkBlitter.h.

Member Function Documentation

◆ apply()

SkBlitter * SkBlitterClipper::apply ( SkBlitter blitter,
const SkRegion clip,
const SkIRect bounds = nullptr 
)

Definition at line 626 of file SkBlitter.cpp.

627 {
628 if (clip) {
629 const SkIRect& clipR = clip->getBounds();
630
631 if (clip->isEmpty() || (ir && !SkIRect::Intersects(clipR, *ir))) {
632 blitter = &fNullBlitter;
633 } else if (clip->isRect()) {
634 if (ir == nullptr || !clipR.contains(*ir)) {
635 fRectBlitter.init(blitter, clipR);
636 blitter = &fRectBlitter;
637 }
638 } else {
639 fRgnBlitter.init(blitter, clip);
640 blitter = &fRgnBlitter;
641 }
642 }
643 return blitter;
644}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
bool isEmpty() const
Definition: SkPath.cpp:416
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
Definition: SkRect.h:32
static bool Intersects(const SkIRect &a, const SkIRect &b)
Definition: SkRect.h:535
bool contains(int32_t x, int32_t y) const
Definition: SkRect.h:463

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