Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / core / SkRasterClip.h
index 29a925f..8a06818 100644 (file)
 
 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; }
@@ -39,14 +41,11 @@ public:
     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);
@@ -63,8 +62,7 @@ public:
      *  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
@@ -79,6 +77,7 @@ public:
 private:
     SkRegion    fBW;
     SkAAClip    fAA;
+    bool        fForceConservativeRects;
     bool        fIsBW;
     // these 2 are caches based on querying the right obj based on fIsBW
     bool        fIsEmpty;
@@ -107,6 +106,11 @@ private:
     }
 
     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 {