class SkRasterClip {
public:
- SkRasterClip();
- SkRasterClip(const SkIRect&);
+ SkRasterClip(bool forceConservativeRects = false);
+ SkRasterClip(const SkIRect&, bool forceConservativeRects = false);
SkRasterClip(const SkRasterClip&);
~SkRasterClip();
+ bool isForceConservativeRects() const { return fForceConservativeRects; }
+
bool isBW() const { return fIsBW; }
bool isAA() const { return !fIsBW; }
const SkRegion& bwRgn() const { SkASSERT(fIsBW); return fBW; }
bool setEmpty();
bool setRect(const SkIRect&);
- bool setPath(const SkPath& path, const SkRegion& clip, bool doAA);
- bool setPath(const SkPath& path, const SkIRect& clip, bool doAA);
-
bool op(const SkIRect&, SkRegion::Op);
bool op(const SkRegion&, SkRegion::Op);
- bool op(const SkRasterClip&, SkRegion::Op);
- bool op(const SkRect&, SkRegion::Op, bool doAA);
-
+ bool op(const SkRect&, const SkISize&, SkRegion::Op, bool doAA);
+ bool op(const SkPath&, const SkISize&, SkRegion::Op, bool doAA);
+
void translate(int dx, int dy, SkRasterClip* dst) const;
void translate(int dx, int dy) {
this->translate(dx, dy, this);
* intersect, but returning true is a guarantee that they do not.
*/
bool quickReject(const SkIRect& rect) const {
- return this->isEmpty() || rect.isEmpty() ||
- !SkIRect::Intersects(this->getBounds(), rect);
+ return !SkIRect::Intersects(this->getBounds(), rect);
}
// hack for SkCanvas::getTotalClip
private:
SkRegion fBW;
SkAAClip fAA;
+ bool fForceConservativeRects;
bool fIsBW;
// these 2 are caches based on querying the right obj based on fIsBW
bool fIsEmpty;
}
void convertToAA();
+
+ bool setPath(const SkPath& path, const SkRegion& clip, bool doAA);
+ bool setPath(const SkPath& path, const SkIRect& clip, bool doAA);
+ bool op(const SkRasterClip&, SkRegion::Op);
+ bool setConservativeRect(const SkRect& r, const SkIRect& clipR, bool isInverse);
};
class SkAutoRasterClipValidate : SkNoncopyable {