aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-12 11:52:53 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-12 11:52:53 +0000
commit071eef918d70b6ca8334bc1241d1ea6923e828d5 (patch)
tree656e90f13ff584693080e2d6e49bc98f23cc3ab5 /src/utils
parente10f6fdf76fa9b627cbb8471b58b13c457af83e8 (diff)
add bool argument to canvas' clipRect and clipPath for antialiasing
(currently ignored) git-svn-id: http://skia.googlecode.com/svn/trunk@2459 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkDumpCanvas.cpp18
-rw-r--r--src/utils/SkNWayCanvas.cpp12
-rw-r--r--src/utils/SkProxyCanvas.cpp8
3 files changed, 22 insertions, 16 deletions
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) {