Index: src/core/SkDrawLooper.cpp |
diff --git a/src/core/SkDrawLooper.cpp b/src/core/SkDrawLooper.cpp |
index d18d12710abd6f2a5c12987a873ae2688554e5c8..1af68a22892d39a524a50f4399fdf243febd275d 100644 |
--- a/src/core/SkDrawLooper.cpp |
+++ b/src/core/SkDrawLooper.cpp |
@@ -32,8 +32,11 @@ bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) const { |
return true; |
} |
-void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& src, |
+void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& s, |
SkRect* dst) const { |
+ // src and dst rects may alias and we need to keep the original src, so copy it. |
+ const SkRect src = s; |
+ |
SkCanvas canvas; |
SkSmallAllocator<1, 32> allocator; |
void* buffer = allocator.reserveT<SkDrawLooper::Context>(this->contextSize()); |