Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| index 19d831308e299cff8b57d5825a9bd4400b1ecd03..a982f2fd39a22a73f5fe5dc6cbe998b10ef7ed2c 100644 |
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| @@ -147,13 +147,13 @@ static PassRefPtr<StaticBitmapImage> cropImage(Image* image, const IntRect& crop |
| if (cropRect == srcRect) { |
| if (flipY) |
| return StaticBitmapImage::create(flipSkImageVertically(skiaImage->newSubset(srcRect), premultiplyAlpha ? PremultiplyAlpha : DontPremultiplyAlpha)); |
| - SkImage* croppedSkImage = skiaImage->newSubset(srcRect); |
| + RefPtr<SkImage> croppedSkImage = fromSkSp(skiaImage->makeSubset(srcRect)); |
| // Special case: The first parameter image is unpremul but we need to turn it into premul. |
| if (premultiplyAlpha && imageFormat == DontPremultiplyAlpha) |
| - return StaticBitmapImage::create(unPremulSkImageToPremul(croppedSkImage)); |
| + return StaticBitmapImage::create(unPremulSkImageToPremul(croppedSkImage.get())); |
| // Call preroll to trigger image decoding. |
| croppedSkImage->preroll(); |
|
f(malita)
2016/06/15 08:41:54
Unrelated to this CL: I think I understand why we
xidachen
2016/06/15 08:56:11
The problem is that ImageBitmapLoader is not alway
xidachen
2016/06/15 08:57:29
sorry, I meant is there a way to check whether the
|
| - return StaticBitmapImage::create(adoptRef(croppedSkImage)); |
| + return StaticBitmapImage::create(croppedSkImage.release()); |
| } |
| sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(cropRect.width(), cropRect.height()); |