diff options
-rw-r--r-- | include/core/SkCanvas.h | 6 | ||||
-rw-r--r-- | include/utils/SkDumpCanvas.h | 6 | ||||
-rw-r--r-- | include/utils/SkNWayCanvas.h | 6 | ||||
-rw-r--r-- | include/utils/SkProxyCanvas.h | 6 | ||||
-rw-r--r-- | src/core/SkPictureRecord.cpp | 10 | ||||
-rw-r--r-- | src/core/SkPictureRecord.h | 4 | ||||
-rw-r--r-- | src/utils/SkDumpCanvas.cpp | 18 | ||||
-rw-r--r-- | src/utils/SkNWayCanvas.cpp | 12 | ||||
-rw-r--r-- | src/utils/SkProxyCanvas.cpp | 8 |
9 files changed, 39 insertions, 37 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 73fd7200ad..160b8fb769 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -245,7 +245,8 @@ public: @return true if the canvas' clip is non-empty */ virtual bool clipRect(const SkRect& rect, - SkRegion::Op op = SkRegion::kIntersect_Op); + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); /** Modify the current clip with the specified path. @param path The path to apply to the current clip @@ -253,7 +254,8 @@ public: @return true if the canvas' new clip is non-empty */ virtual bool clipPath(const SkPath& path, - SkRegion::Op op = SkRegion::kIntersect_Op); + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); /** Modify the current clip with the specified region. Note that unlike clipRect() and clipPath() which transform their arguments by the current diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h index 17e7cde67c..c80ae8c392 100644 --- a/include/utils/SkDumpCanvas.h +++ b/include/utils/SkDumpCanvas.h @@ -70,10 +70,8 @@ public: virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; - virtual bool clipRect(const SkRect& rect, - SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; - virtual bool clipPath(const SkPath& path, - SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; + virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; + virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; virtual bool clipRegion(const SkRegion& deviceRgn, SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; diff --git a/include/utils/SkNWayCanvas.h b/include/utils/SkNWayCanvas.h index ee4dc80205..bba24ab8ed 100644 --- a/include/utils/SkNWayCanvas.h +++ b/include/utils/SkNWayCanvas.h @@ -33,10 +33,8 @@ public: virtual bool skew(SkScalar sx, SkScalar sy); virtual bool concat(const SkMatrix& matrix); virtual void setMatrix(const SkMatrix& matrix); - virtual bool clipRect(const SkRect& rect, - SkRegion::Op op = SkRegion::kIntersect_Op); - virtual bool clipPath(const SkPath& path, - SkRegion::Op op = SkRegion::kIntersect_Op); + virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; + virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; virtual bool clipRegion(const SkRegion& deviceRgn, SkRegion::Op op = SkRegion::kIntersect_Op); diff --git a/include/utils/SkProxyCanvas.h b/include/utils/SkProxyCanvas.h index 039f1cc81e..e96b9b2dac 100644 --- a/include/utils/SkProxyCanvas.h +++ b/include/utils/SkProxyCanvas.h @@ -38,10 +38,8 @@ public: virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; - virtual bool clipRect(const SkRect& rect, - SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; - virtual bool clipPath(const SkPath& path, - SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; + virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; + virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; virtual bool clipRegion(const SkRegion& deviceRgn, SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index c1c1cbb565..a8a4cb2623 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -163,7 +163,7 @@ void SkPictureRecord::recordOffsetForRestore(SkRegion::Op op) { fRestoreOffsetStack.top() = offset; } -bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op) { +bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { addDraw(CLIP_RECT); addRect(rect); addInt(op); @@ -171,10 +171,10 @@ bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op) { this->recordOffsetForRestore(op); validate(); - return this->INHERITED::clipRect(rect, op); + return this->INHERITED::clipRect(rect, op, doAA); } -bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op) { +bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { addDraw(CLIP_PATH); addPath(path); addInt(op); @@ -184,9 +184,9 @@ bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op) { validate(); if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) { - return this->INHERITED::clipRect(path.getBounds(), op); + return this->INHERITED::clipRect(path.getBounds(), op, doAA); } else { - return this->INHERITED::clipPath(path, op); + return this->INHERITED::clipPath(path, op, doAA); } } diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h index 96ed607320..512f3ad848 100644 --- a/src/core/SkPictureRecord.h +++ b/src/core/SkPictureRecord.h @@ -30,8 +30,8 @@ public: virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; - virtual bool clipRect(const SkRect& rect, SkRegion::Op op) SK_OVERRIDE; - virtual bool clipPath(const SkPath& path, SkRegion::Op op) SK_OVERRIDE; + virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; + virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE; virtual void clear(SkColor) SK_OVERRIDE; virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index c66eb684e2..db62498bac 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -233,18 +233,24 @@ void SkDumpCanvas::setMatrix(const SkMatrix& matrix) { /////////////////////////////////////////////////////////////////////////////// -bool SkDumpCanvas::clipRect(const SkRect& rect, SkRegion::Op op) { +static const char* bool_to_aastring(bool doAA) { + return doAA ? "AA" : "BW"; +} + +bool SkDumpCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { SkString str; toString(rect, &str); - this->dump(kClip_Verb, NULL, "clipRect(%s %s)", str.c_str(), toString(op)); - return this->INHERITED::clipRect(rect, op); + this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op), + bool_to_aastring(doAA)); + return this->INHERITED::clipRect(rect, op, doAA); } -bool SkDumpCanvas::clipPath(const SkPath& path, SkRegion::Op op) { +bool SkDumpCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { SkString str; toString(path, &str); - this->dump(kClip_Verb, NULL, "clipPath(%s %s)", str.c_str(), toString(op)); - return this->INHERITED::clipPath(path, op); + this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op), + bool_to_aastring(doAA)); + return this->INHERITED::clipPath(path, op, doAA); } bool SkDumpCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp index 016ea9169b..24c992d208 100644 --- a/src/utils/SkNWayCanvas.cpp +++ b/src/utils/SkNWayCanvas.cpp @@ -129,20 +129,20 @@ void SkNWayCanvas::setMatrix(const SkMatrix& matrix) { this->INHERITED::setMatrix(matrix); } -bool SkNWayCanvas::clipRect(const SkRect& rect, SkRegion::Op op) { +bool SkNWayCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { Iter iter(fList); while (iter.next()) { - iter->clipRect(rect, op); + iter->clipRect(rect, op, doAA); } - return this->INHERITED::clipRect(rect, op); + return this->INHERITED::clipRect(rect, op, doAA); } -bool SkNWayCanvas::clipPath(const SkPath& path, SkRegion::Op op) { +bool SkNWayCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { Iter iter(fList); while (iter.next()) { - iter->clipPath(path, op); + iter->clipPath(path, op, doAA); } - return this->INHERITED::clipPath(path, op); + return this->INHERITED::clipPath(path, op, doAA); } bool SkNWayCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp index 5664a7a200..bc21d52649 100644 --- a/src/utils/SkProxyCanvas.cpp +++ b/src/utils/SkProxyCanvas.cpp @@ -58,12 +58,12 @@ void SkProxyCanvas::setMatrix(const SkMatrix& matrix) { fProxy->setMatrix(matrix); } -bool SkProxyCanvas::clipRect(const SkRect& rect, SkRegion::Op op) { - return fProxy->clipRect(rect, op); +bool SkProxyCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { + return fProxy->clipRect(rect, op, doAA); } -bool SkProxyCanvas::clipPath(const SkPath& path, SkRegion::Op op) { - return fProxy->clipPath(path, op); +bool SkProxyCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { + return fProxy->clipPath(path, op, doAA); } bool SkProxyCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |