diff options
author | fmalita <fmalita@chromium.org> | 2014-11-20 10:44:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-20 10:44:58 -0800 |
commit | 2d97bc139a7de5813468bd3dbfd0037351ae5606 (patch) | |
tree | afc63f2cb5cfaf55d4b2588963fc3b91673c5786 /src/core | |
parent | d6ab2a8e45f6c473c076a828aa401919d7519d05 (diff) |
Disable LCD text explicitly in SkPictureImageFilter::onFilterImage()
As an intermediate fix for
https://code.google.com/p/skia/issues/detail?id=3142, we can use a
non-public SkCanvas constructor and force-disable LCD text.
BUG=skia:3142
R=reed@google.com,senorblanco@google.com
Review URL: https://codereview.chromium.org/725243004
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 |