Index: src/effects/SkLightingImageFilter.cpp |
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp |
index 199bb4d684f8e3ab842f1f44d22126e8b3f75197..bac83e537dc9ce9c8292743234ea036d56e18ad8 100644 |
--- a/src/effects/SkLightingImageFilter.cpp |
+++ b/src/effects/SkLightingImageFilter.cpp |
@@ -8,6 +8,7 @@ |
#include "SkLightingImageFilter.h" |
#include "SkBitmap.h" |
#include "SkColorPriv.h" |
+#include "SkDevice.h" |
#include "SkPoint3.h" |
#include "SkReadBuffer.h" |
#include "SkTypes.h" |
@@ -1190,9 +1191,12 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, |
return false; |
} |
- if (!dst->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { |
+ SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height())); |
+ if (!device) { |
return false; |
} |
+ *dst = device->accessBitmap(false); |
+ SkAutoLockPixels alp_dst(*dst); |
SkMatrix matrix(ctx.ctm()); |
matrix.postTranslate(SkIntToScalar(-srcOffset.x()), SkIntToScalar(-srcOffset.y())); |
@@ -1331,9 +1335,12 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, |
return false; |
} |
- if (!dst->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { |
+ SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds.height())); |
+ if (!device) { |
return false; |
} |
+ *dst = device->accessBitmap(false); |
+ SkAutoLockPixels alp_dst(*dst); |
SpecularLightingType lightingType(fKS, fShininess); |
offset->fX = bounds.left(); |