Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/core/SkDrawLooper.cpp

Issue 760023004: Copy src in SkDrawLooper::computeFastBounds(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698