Broken in https://chromium.googlesource.com/skia/+/
76033be
I have confirmed that this fixes 470083.
BUG=470083
Review URL: https://codereview.chromium.org/
1080923004
static SkPixelGeometry AdjustGeometry(const SkImageInfo&, TileUsage, SkPixelGeometry);
// The constructor may change the pixel geometry based on other parameters.
- CreateInfo(const SkImageInfo& info, TileUsage tileUsage, SkPixelGeometry geo)
+ CreateInfo(const SkImageInfo& info,
+ TileUsage tileUsage,
+ SkPixelGeometry geo,
+ bool forImageFilter = false)
: fInfo(info)
, fTileUsage(tileUsage)
, fPixelGeometry(AdjustGeometry(info, tileUsage, geo))
- {}
+ , fForImageFilter(forImageFilter) {}
const SkImageInfo fInfo;
const TileUsage fTileUsage;
const SkPixelGeometry fPixelGeometry;
+ const bool fForImageFilter;
};
/**
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 {
}
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());