Index: src/core/SkMaskFilter.cpp |
=================================================================== |
--- src/core/SkMaskFilter.cpp (revision 3647) |
+++ src/core/SkMaskFilter.cpp (working copy) |
@@ -8,6 +8,7 @@ |
#include "SkMaskFilter.h" |
+#include "SkBitmapProcShader.h" |
#include "SkBlitter.h" |
#include "SkBounder.h" |
#include "SkBuffer.h" |
@@ -19,14 +20,15 @@ |
return false; |
} |
-bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix, |
- const SkRasterClip& clip, SkBounder* bounder, |
- SkBlitter* blitter, SkPaint::Style style) { |
+bool SkMaskFilter::filterPath(const SkPath& devPath, const SkBitmap& devBitmap, |
+ const SkMatrix& matrix, const SkRasterClip& clip, |
+ SkBounder* bounder, const SkPaint& origPaint, |
+ SkPaint::Style style) { |
SkMask srcM, dstM; |
if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), this, &matrix, &srcM, |
SkMask::kComputeBoundsAndRenderImage_CreateMode, |
- style)) { |
+ style, origPaint.getShader())) { |
return false; |
} |
SkAutoMaskFreeImage autoSrc(srcM.fImage); |
@@ -36,12 +38,17 @@ |
} |
SkAutoMaskFreeImage autoDst(dstM.fImage); |
+ SkPaint paint(origPaint); |
+ paint.setShader(NULL); |
+ SkBlitter* origBlitter = SkBlitter::Choose(devBitmap, matrix, paint); |
+ |
// if we get here, we need to (possibly) resolve the clip and blitter |
- SkAAClipBlitterWrapper wrapper(clip, blitter); |
- blitter = wrapper.getBlitter(); |
+ SkAAClipBlitterWrapper wrapper(clip, origBlitter); |
+ SkBlitter* blitter = wrapper.getBlitter(); |
SkRegion::Cliperator clipper(wrapper.getRgn(), dstM.fBounds); |
+ |
if (!clipper.done() && (bounder == NULL || bounder->doIRect(dstM.fBounds))) { |
const SkIRect& cr = clipper.rect(); |
do { |
@@ -49,6 +56,7 @@ |
clipper.next(); |
} while (!clipper.done()); |
} |
+ SkDELETE(origBlitter); |
return true; |
} |