fix memory leak in new setXfermode()

git-svn-id: http://skia.googlecode.com/svn/trunk@238 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-06-24 12:29:16 +00:00
parent ee0eb012c5
commit d66eef7101

View File

@ -1437,6 +1437,12 @@ SkXfermode* SkPaint::setXfermode(SkXfermode* mode)
return mode;
}
SkXfermode* SkPaint::setXfermode(SkXfermode::Mode mode) {
SkSafeUnref(fXfermode);
fXfermode = SkXfermode::Create(mode);
return fXfermode;
}
SkPathEffect* SkPaint::setPathEffect(SkPathEffect* effect)
{
SkRefCnt_SafeAssign(fPathEffect, effect);
@ -1449,11 +1455,6 @@ SkMaskFilter* SkPaint::setMaskFilter(SkMaskFilter* filter)
return filter;
}
// Helpers
SkXfermode* SkPaint::setXfermode(SkXfermode::Mode mode) {
return this->setXfermode(SkXfermode::Create(mode));
}
////////////////////////////////////////////////////////////////////////////////////////
bool SkPaint::getFillPath(const SkPath& src, SkPath* dst) const