class SkBlitter; class SkMatrix; class SkPath; class SkRRect; enumclass SkClipOp;
/** * Wraps a SkRegion and SkAAClip, so we have a single object that can represent either our * BW or antialiased clips.
*/ class SkRasterClip { public:
SkRasterClip(); explicit SkRasterClip(const SkIRect&); explicit SkRasterClip(const SkRegion&); explicit SkRasterClip(const SkRasterClip&);
SkRasterClip(const SkPath& path, const SkIRect& bounds, bool doAA);
/** * Return true if this region is empty, or if the specified rectangle does * not intersect the region. Returning false is not a guarantee that they * intersect, but returning true is a guarantee that they do not.
*/ bool quickReject(const SkIRect& rect) const { return !SkIRect::Intersects(this->getBounds(), rect);
}
private:
SkRegion fBW;
SkAAClip fAA; bool fIsBW; // these 2 are caches based on querying the right obj based on fIsBW bool fIsEmpty; bool fIsRect; // if present, this augments the clip, not replaces it
sk_sp<SkShader> fShader;
// detect that our computed AA is really just a (hard-edged) rect if (detectAARect && !fIsEmpty && !fIsBW && fAA.isRect()) {
fBW.setRect(fAA.getBounds());
fAA.setEmpty(); // don't need this anymore
fIsBW = true;
}
/** * Encapsulates the logic of deciding if we need to change/wrap the blitter * for aaclipping. If so, getRgn and getBlitter return modified values. If * not, they return the raw blitter and (bw) clip region. * * We need to keep the constructor/destructor cost as small as possible, so we * can freely put this on the stack, and not pay too much for the case when * we're really BW anyways.
*/ class SkAAClipBlitterWrapper { public:
SkAAClipBlitterWrapper();
SkAAClipBlitterWrapper(const SkRasterClip&, SkBlitter*);
SkAAClipBlitterWrapper(const SkAAClip*, SkBlitter*);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.