From 00b7e5eb973a1b1e4d1affa74fc0341e8c41e3da Mon Sep 17 00:00:00 2001 From: halcanary Date: Wed, 15 Apr 2015 13:05:18 -0700 Subject: SkPDF/Device/ImageFilter: Fix ImageFilter fallback code Broken in https://chromium.googlesource.com/skia/+/76033be I have confirmed that this fixes 470083. BUG=470083 Review URL: https://codereview.chromium.org/1080923004 --- src/core/SkDeviceImageFilterProxy.h | 3 ++- src/pdf/SkPDFDevice.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/SkDeviceImageFilterProxy.h b/src/core/SkDeviceImageFilterProxy.h index 06df759bc3..dcf12f7c40 100644 --- a/src/core/SkDeviceImageFilterProxy.h +++ b/src/core/SkDeviceImageFilterProxy.h @@ -22,7 +22,8 @@ public: SkBaseDevice* createDevice(int w, int h) override { SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), SkBaseDevice::kNever_TileUsage, - kUnknown_SkPixelGeometry); + kUnknown_SkPixelGeometry, + true /*forImageFilter*/); return fDevice->onCreateDevice(cinfo, NULL); } bool canHandleImageFilter(const SkImageFilter* filter) override { diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 5167474f10..1b16397512 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -577,7 +577,8 @@ static bool not_supported_for_layers(const SkPaint& layerPaint) { } SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint* layerPaint) { - if (layerPaint && not_supported_for_layers(*layerPaint)) { + if (cinfo.fForImageFilter || + (layerPaint && not_supported_for_layers(*layerPaint))) { return SkBitmapDevice::Create(cinfo.fInfo); } SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height()); -- cgit v1.2.3