Fix computation of bound in FillBounds::updateSaveBounds
intersect doesn't change the bounds when the two bounds do not intersect. This is definitely not the intended behavior.
With the SKPs captured on 12/23/14, Chrome began passing Skia drawPicture ops that did not intersect the current clip - which revealed this bug.
Review URL: https://codereview.chromium.org/817483004
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 6a2a5e3..3d6f3a0 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -220,7 +220,10 @@
// Nothing can draw outside the current clip.
// (Only bounded ops call into this method, so oddballs like Clear don't matter here.)
- rect.intersect(fCurrentClipBounds);
+ if (!rect.intersect(fCurrentClipBounds)) {
+ return Bounds::MakeEmpty();
+ }
+
return rect;
}