diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index 82d6096be5..44f6ef10b5 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -11,7 +11,6 @@ #include "SkBitmapProcShader.h" #include "SkCanvas.h" #include "SkImage.h" -#include "SkImageGenerator.h" #include "SkMatrixUtils.h" #include "SkPicture.h" #include "SkReadBuffer.h" @@ -220,16 +219,8 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM tileMatrix.setRectToRect(fTile, SkRect::MakeIWH(tileSize.width(), tileSize.height()), SkMatrix::kFill_ScaleToFit); - SkAutoTDelete tileGenerator( - SkImageGenerator::NewFromPicture(tileSize, fPicture, &tileMatrix, nullptr)); - if (!tileGenerator) { - return nullptr; - } - - // Grab this before the generator goes poof! - const SkImageInfo tileInfo = tileGenerator->getInfo(); - - SkAutoTUnref tileImage(SkImage::NewFromGenerator(tileGenerator.detach())); + SkAutoTUnref tileImage( + SkImage::NewFromPicture(fPicture, tileSize, &tileMatrix, nullptr)); if (!tileImage) { return nullptr; } @@ -238,6 +229,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM shaderMatrix.preScale(1 / tileScale.width(), 1 / tileScale.height()); tileShader.reset(tileImage->newShader(fTmx, fTmy, &shaderMatrix)); + const SkImageInfo tileInfo = SkImageInfo::MakeN32Premul(tileSize); SkResourceCache::Add(new BitmapShaderRec(key, tileShader.get(), tileInfo.getSafeSize(tileInfo.minRowBytes()))); }