Index: src/effects/SkMagnifierImageFilter.cpp |
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp |
index 9138c867b56e0d94749e7493e917e21499613b21..903f34ca147cd76fa428d4ced96f9afc383e0fb2 100644 |
--- a/src/effects/SkMagnifierImageFilter.cpp |
+++ b/src/effects/SkMagnifierImageFilter.cpp |
@@ -8,6 +8,7 @@ |
#include "SkBitmap.h" |
#include "SkMagnifierImageFilter.h" |
#include "SkColorPriv.h" |
+#include "SkDevice.h" |
#include "SkReadBuffer.h" |
#include "SkWriteBuffer.h" |
#include "SkValidationUtils.h" |
@@ -300,7 +301,7 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { |
buffer.writeScalar(fInset); |
} |
-bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, |
+bool SkMagnifierImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, |
const Context&, SkBitmap* dst, |
SkIPoint* offset) const { |
if ((src.colorType() != kN32_SkColorType) || |
@@ -315,9 +316,12 @@ bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, |
return false; |
} |
- if (!dst->tryAllocPixels(src.info())) { |
+ SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(src.width(), src.height())); |
+ if (!device) { |
return false; |
} |
+ *dst = device->accessBitmap(false); |
+ SkAutoLockPixels alp_dst(*dst); |
SkScalar inv_inset = fInset > 0 ? SkScalarInvert(fInset) : SK_Scalar1; |