Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(727)

Unified Diff: src/core/SkMaskFilter.cpp

Issue 5981063: Fix shadow blurs of RGBA bitmaps Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Handle SkBitmapProcShaders in drawPath() Created 13 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkRasterizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkRasterizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b