Index: src/core/SkMaskFilter.cpp |
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp |
index 9c367f946b552798447eb89eec20b3237f481afe..cd2571637749ac1f318ada65167ba7ab1aa0187e 100644 |
--- a/src/core/SkMaskFilter.cpp |
+++ b/src/core/SkMaskFilter.cpp |
@@ -12,6 +12,7 @@ |
#include "SkBounder.h" |
#include "SkDraw.h" |
#include "SkRasterClip.h" |
+#include "SkRRect.h" |
#include "SkTypes.h" |
#if SK_SUPPORT_GPU |
@@ -204,6 +205,26 @@ static int countNestedRects(const SkPath& path, SkRect rects[2]) { |
return path.isRect(&rects[0]); |
} |
+bool SkMaskFilter::filterRRect(const SkRRect& devRRect, const SkMatrix& matrix, |
+ const SkRasterClip& clip, SkBounder* bounder, |
+ SkBlitter* blitter, SkPaint::Style style) const { |
+ // Attempt to speed up drawing by creating a nine patch. If a nine patch |
+ // cannot be used, return false to allow our caller to recover and perform |
+ // the drawing another way. |
+ NinePatch patch; |
+ patch.fMask.fImage = NULL; |
+ if (kTrue_FilterReturn != this->filterRRectToNine(devRRect, matrix, |
+ clip.getBounds(), |
+ &patch)) { |
+ SkASSERT(NULL == patch.fMask.fImage); |
+ return false; |
+ } |
+ draw_nine(patch.fMask, patch.fOuterRect, patch.fCenter, true, clip, |
+ bounder, blitter); |
+ SkMask::FreeImage(patch.fMask.fImage); |
+ return true; |
+} |
+ |
bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix, |
const SkRasterClip& clip, SkBounder* bounder, |
SkBlitter* blitter, SkPaint::Style style) const { |
@@ -267,6 +288,12 @@ bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix, |
} |
SkMaskFilter::FilterReturn |
+SkMaskFilter::filterRRectToNine(const SkRRect&, const SkMatrix&, |
+ const SkIRect& clipBounds, NinePatch*) const { |
+ return kUnimplemented_FilterReturn; |
+} |
+ |
+SkMaskFilter::FilterReturn |
SkMaskFilter::filterRectsToNine(const SkRect[], int count, const SkMatrix&, |
const SkIRect& clipBounds, NinePatch*) const { |
return kUnimplemented_FilterReturn; |