Make SkSpecialSurfaces always use kUnknown for their pixel geometry

This now matches how the SkDevices were being created by the device proxy and prevents LCD text from being inadvertently applied.

BUG=602555

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1878143004

Review URL: https://codereview.chromium.org/1878143004
This commit is contained in:
robertphillips 2016-04-13 07:18:41 -07:00 committed by Commit bot
parent 903ec3ce4d
commit 0b7e5a13bd
2 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ static SkSpecialSurface_Base* as_SB(SkSpecialSurface* surface) {
SkSpecialSurface::SkSpecialSurface(SkImageFilter::Proxy* proxy,
const SkIRect& subset,
const SkSurfaceProps* props)
: fProps(SkSurfacePropsCopyOrDefault(props))
: fProps(SkSurfacePropsCopyOrDefault(props).flags(), kUnknown_SkPixelGeometry)
, fSubset(subset)
, fProxy(proxy) {
SkASSERT(fSubset.width() > 0);
@ -76,7 +76,7 @@ public:
fBitmap.setInfo(info, info.minRowBytes());
fBitmap.setPixelRef(pr);
fCanvas.reset(new SkCanvas(fBitmap));
fCanvas.reset(new SkCanvas(fBitmap, this->props()));
}
~SkSpecialSurface_Raster() override { }

View File

@ -108,9 +108,9 @@ sk_sp<SkSpecialImage> SkPictureImageFilter::onFilterImage(SkSpecialImage* source
canvas->clear(0x0);
if (kDeviceSpace_PictureResolution == fPictureResolution ||
if (kDeviceSpace_PictureResolution == fPictureResolution ||
0 == (ctx.ctm().getType() & ~SkMatrix::kTranslate_Mask)) {
this->drawPictureAtDeviceResolution(canvas, bounds, ctx);
this->drawPictureAtDeviceResolution(canvas, bounds, ctx);
} else {
this->drawPictureAtLocalResolution(source, canvas, bounds, ctx);
}