Index: src/core/SkPath.cpp |
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp |
index 006fcf85f24d79bf700d33aad8ea86703d4c57ec..fbeb59fffc9e0f6d7e7624f1e1a49ce2b23e6998 100644 |
--- a/src/core/SkPath.cpp |
+++ b/src/core/SkPath.cpp |
@@ -13,6 +13,7 @@ |
#include "SkPathRef.h" |
#include "SkRRect.h" |
#include "SkThread.h" |
+#include "SkErrorInternals.h" |
scroggo
2013/04/08 19:24:53
Should be in alphabetical order.
humper
2013/04/08 19:43:23
Done.
|
//////////////////////////////////////////////////////////////////////////// |
@@ -1034,6 +1035,14 @@ bool SkPath::hasOnlyMoveTos() const { |
void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, |
Direction dir) { |
assert_known_direction(dir); |
+ |
+ if (rx < 0 || ry < 0) { |
+ SkErrorInternals::SetError( kError_InvalidArgument, |
+ "I got %f and %f as radii to SkPath::AddRoundRect, " |
+ "but negative radii are not allowed.", |
+ SkScalarToDouble(rx), SkScalarToDouble(ry) ); |
+ return; |
+ } |
SkScalar w = rect.width(); |
SkScalar halfW = SkScalarHalf(w); |