Index: gm/offsetimagefilter.cpp |
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp |
index 7fcbe0a04db973ec8355bdac280bef6fc92ab0e9..3dafed8823ef498a798a99d8b59797d511e6e55d 100644 |
--- a/gm/offsetimagefilter.cpp |
+++ b/gm/offsetimagefilter.cpp |
@@ -82,8 +82,9 @@ protected: |
scaleMatrix.setScale(scale, scale); |
SkRect cropRectFloat; |
scaleMatrix.mapRect(&cropRectFloat, SkRect::Make(cropRect)); |
- clipRect.intersect(cropRectFloat); |
- canvas->drawRect(clipRect, strokePaint); |
+ if (clipRect.intersect(cropRectFloat)) { |
+ canvas->drawRect(clipRect, strokePaint); |
+ } |
} |
virtual void onDraw(SkCanvas* canvas) { |