diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 4 | ||||
-rw-r--r-- | src/core/SkDeviceImageFilterProxy.h | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index a4e4df3554..bf736e9e25 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1219,7 +1219,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, SkImageFilter* filter = paint->getImageFilter(); SkIPoint pos = { x - iter.getX(), y - iter.getY() }; if (filter && !dstDev->canHandleImageFilter(filter)) { - SkDeviceImageFilterProxy proxy(dstDev); + SkDeviceImageFilterProxy proxy(dstDev, fProps); SkBitmap dst; SkIPoint offset = SkIPoint::Make(0, 0); const SkBitmap& src = srcDev->accessBitmap(false); @@ -1261,7 +1261,7 @@ void SkCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, SkImageFilter* filter = paint->getImageFilter(); SkIPoint pos = { x - iter.getX(), y - iter.getY() }; if (filter && !iter.fDevice->canHandleImageFilter(filter)) { - SkDeviceImageFilterProxy proxy(iter.fDevice); + SkDeviceImageFilterProxy proxy(iter.fDevice, fProps); SkBitmap dst; SkIPoint offset = SkIPoint::Make(0, 0); SkMatrix matrix = *iter.fMatrix; diff --git a/src/core/SkDeviceImageFilterProxy.h b/src/core/SkDeviceImageFilterProxy.h index d7ab646867..621ff3f507 100644 --- a/src/core/SkDeviceImageFilterProxy.h +++ b/src/core/SkDeviceImageFilterProxy.h @@ -8,11 +8,19 @@ #ifndef SkDeviceImageFilterProxy_DEFINED #define SkDeviceImageFilterProxy_DEFINED +#include "SkDevice.h" #include "SkImageFilter.h" +#include "SkSurfaceProps.h" class SkDeviceImageFilterProxy : public SkImageFilter::Proxy { public: - SkDeviceImageFilterProxy(SkBaseDevice* device) : fDevice(device) {} + SkDeviceImageFilterProxy(SkBaseDevice* device, const SkSurfaceProps& props) + : fDevice(device) + , fProps(props.flags(), + SkBaseDevice::CreateInfo::AdjustGeometry(SkImageInfo(), + SkBaseDevice::kImageFilter_Usage, + props.pixelGeometry())) + {} virtual SkBaseDevice* createDevice(int w, int h) SK_OVERRIDE { SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), @@ -29,8 +37,13 @@ public: return fDevice->filterImage(filter, src, ctx, result, offset); } + virtual const SkSurfaceProps* surfaceProps() const SK_OVERRIDE { + return &fProps; + } + private: - SkBaseDevice* fDevice; + SkBaseDevice* fDevice; + const SkSurfaceProps fProps; }; #endif |