*/
static bool DrawToMask(const SkPath& devPath, const SkIRect* clipBounds,
SkMaskFilter* filter, const SkMatrix* filterMatrix,
- SkMask* mask, SkMask::CreateMode mode);
+ SkMask* mask, SkMask::CreateMode mode,
+ SkPaint::Style style);
enum RectType {
kHair_RectType,
#include "SkFlattenable.h"
#include "SkMask.h"
+#include "SkPaint.h"
class SkBlitter;
class SkBounder;
This method is not exported to java.
*/
bool filterPath(const SkPath& devPath, const SkMatrix& devMatrix,
- const SkRasterClip&, SkBounder*, SkBlitter* blitter);
+ const SkRasterClip&, SkBounder*, SkBlitter* blitter,
+ SkPaint::Style style);
typedef SkFlattenable INHERITED;
};
SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint);
- // how does filterPath() know to fill or hairline the path??? <mrr>
- if (paint->getMaskFilter() &&
- paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC,
- fBounder, blitter.get())) {
- return; // filterPath() called the blitter, so we're done
+ if (paint->getMaskFilter()) {
+ SkPaint::Style style = doFill ? SkPaint::kFill_Style :
+ SkPaint::kStroke_Style;
+ if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC,
+ fBounder, blitter.get(),
+ style)) {
+ return; // filterPath() called the blitter, so we're done
+ }
}
if (fBounder && !fBounder->doPath(*devPathPtr, *paint, doFill)) {
return true;
}
-static void draw_into_mask(const SkMask& mask, const SkPath& devPath) {
+static void draw_into_mask(const SkMask& mask, const SkPath& devPath,
+ SkPaint::Style style) {
SkBitmap bm;
SkDraw draw;
SkRasterClip clip;
draw.fMatrix = &matrix;
draw.fBounder = NULL;
paint.setAntiAlias(true);
+ paint.setStyle(style);
draw.drawPath(devPath, paint);
}
bool SkDraw::DrawToMask(const SkPath& devPath, const SkIRect* clipBounds,
SkMaskFilter* filter, const SkMatrix* filterMatrix,
- SkMask* mask, SkMask::CreateMode mode) {
+ SkMask* mask, SkMask::CreateMode mode,
+ SkPaint::Style style) {
if (SkMask::kJustRenderImage_CreateMode != mode) {
if (!compute_bounds(devPath, clipBounds, filter, filterMatrix, &mask->fBounds))
return false;
}
if (SkMask::kJustComputeBounds_CreateMode != mode) {
- draw_into_mask(*mask, devPath);
+ draw_into_mask(*mask, devPath, style);
}
return true;
bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix,
const SkRasterClip& clip, SkBounder* bounder,
- SkBlitter* blitter) {
+ SkBlitter* blitter, SkPaint::Style style) {
SkMask srcM, dstM;
if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), this, &matrix, &srcM,
- SkMask::kComputeBoundsAndRenderImage_CreateMode)) {
+ SkMask::kComputeBoundsAndRenderImage_CreateMode,
+ style)) {
return false;
}
SkAutoMaskFreeImage autoSrc(srcM.fImage);
SkPath devPath;
fillPath.transform(matrix, &devPath);
- return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode);
+ return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode,
+ SkPaint::kFill_Style);
}
filter, //just to compute how much to draw.
&matrix,
&rasteredMask,
- SkMask::kComputeBoundsAndRenderImage_CreateMode)) {
+ SkMask::kComputeBoundsAndRenderImage_CreateMode,
+ SkPaint::kFill_Style)) {
SkAutoMaskFreeImage rasteredAmi(rasteredMask.fImage);
mask = &rasteredMask;
SkMask mask;
if (!SkDraw::DrawToMask(devPath, clipBounds, paint.getMaskFilter(),
&matrix, &mask,
- SkMask::kJustComputeBounds_CreateMode)) {
+ SkMask::kJustComputeBounds_CreateMode,
+ SkPaint::kFill_Style)) {
return false;
}
SkMask srcM, dstM;
if (!SkDraw::DrawToMask(path, &clip.getBounds(), filter, &matrix, &srcM,
- SkMask::kComputeBoundsAndRenderImage_CreateMode)) {
+ SkMask::kComputeBoundsAndRenderImage_CreateMode,
+ SkPaint::kFill_Style)) {
return false;
}
SkAutoMaskFreeImage autoSrc(srcM.fImage);