Index: src/effects/SkRectShaderImageFilter.cpp |
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp |
index b1faebc813646c0a67eb4dca01f940d58445264b..37d6af28adccb2201fb719aa56d5a4f7c47f4fd3 100644 |
--- a/src/effects/SkRectShaderImageFilter.cpp |
+++ b/src/effects/SkRectShaderImageFilter.cpp |
@@ -16,9 +16,17 @@ SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const SkRe |
SkASSERT(s); |
#ifdef SK_CROP_RECT_IS_INT |
SkIRect cropRect; |
- rect.roundOut(&cropRect); |
+ if (rect.width() == 0 || rect.height() == 0) { |
+ cropRect = SkIRect::MakeLargest(); |
+ } else { |
+ rect.roundOut(&cropRect); |
+ } |
#else |
- CropRect cropRect(rect); |
+ uint32_t flags = CropRect::kHasAll_CropEdge; |
+ if (rect.width() == 0 || rect.height() == 0) { |
+ flags = 0x0; |
+ } |
+ CropRect cropRect(rect, flags); |
#endif |
return SkNEW_ARGS(SkRectShaderImageFilter, (s, &cropRect)); |
} |