Index: src/core/SkRRect.cpp |
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp |
index 9bb6725deac3c4ed79c3b6068e563f62ce3ea2f8..10d3d7676b66c6b9ee32335aec7cae932415a3df 100644 |
--- a/src/core/SkRRect.cpp |
+++ b/src/core/SkRRect.cpp |
@@ -342,6 +342,19 @@ bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const { |
// At this point, this is guaranteed to succeed, so we can modify dst. |
dst->fRect = newRect; |
+ // Since the only transforms that were allowed are scale and translate, the type |
+ // remains unchanged. |
+ dst->fType = fType; |
+ |
+ if (kOval_Type == fType) { |
+ for (int i = 0; i < 4; ++i) { |
+ dst->fRadii[i].fX = SkScalarHalf(newRect.width()); |
+ dst->fRadii[i].fY = SkScalarHalf(newRect.height()); |
+ } |
+ SkDEBUGCODE(dst->validate();) |
+ return true; |
+ } |
+ |
// Now scale each corner |
SkScalar xScale = matrix.getScaleX(); |
const bool flipX = xScale < 0; |
@@ -377,10 +390,6 @@ bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const { |
SkTSwap(dst->fRadii[kUpperRight_Corner], dst->fRadii[kLowerRight_Corner]); |
} |
- // Since the only transforms that were allowed are scale and translate, the type |
- // remains unchanged. |
- dst->fType = fType; |
- |
SkDEBUGCODE(dst->validate();) |
return true; |