check for inverted rects before we quick-reject
BUG=skia:
Review URL: https://codereview.chromium.org/908353002
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index ce99546..c523ca0 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1776,7 +1776,12 @@
SkRect storage;
const SkRect* bounds = NULL;
if (paint.canComputeFastBounds()) {
- bounds = &paint.computeFastBounds(r, &storage);
+ // Skia will draw an inverted rect, because it explicitly "sorts" it downstream.
+ // To prevent accidental rejecting at this stage, we have to sort it before we check.
+ SkRect tmp(r);
+ tmp.sort();
+
+ bounds = &paint.computeFastBounds(tmp, &storage);
if (this->quickReject(*bounds)) {
return;
}