Handle nullptr from asTextureRef

This can fail, if the special image dimensions are larger than the maximum
allowable render target dimensions.

BUG=chromium:666519
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2520043003

Review-Url: https://codereview.chromium.org/2520043003
This commit is contained in:
brianosman 2016-11-22 12:03:53 -08:00 committed by Commit bot
parent e8eed323ef
commit 818d8a99e8

View File

@ -352,6 +352,9 @@ sk_sp<SkImage> SkImage::makeWithFilter(const SkImageFilter* filter, const SkIRec
if (result->isTextureBacked()) {
GrContext* context = result->getContext();
sk_sp<GrTexture> texture = result->asTextureRef(context);
if (!texture) {
return nullptr;
}
fullSize = SkIRect::MakeWH(texture->width(), texture->height());
}
#endif