Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
| index 40952951b85fb16987b40f5a4ab85f7c284ea00a..c452e282b5b8aaa3f39c1cbcede98277108e166b 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
| @@ -79,7 +79,6 @@ void ImageFrame::clearPixelData() { |
| void ImageFrame::zeroFillPixelData() { |
| m_bitmap.eraseARGB(0, 0, 0, 0); |
| - m_hasAlpha = true; |
| } |
| bool ImageFrame::copyBitmapData(const ImageFrame& other) { |
| @@ -103,22 +102,17 @@ bool ImageFrame::takeBitmapDataIfWritable(ImageFrame* other) { |
| return true; |
| } |
| -bool ImageFrame::setSizeAndColorSpace(int newWidth, |
| - int newHeight, |
| - sk_sp<SkColorSpace> colorSpace) { |
| - // setSizeAndColorSpace() should only be called once, it leaks memory |
| - // otherwise. |
| +bool ImageFrame::allocatePixelData(int newWidth, |
| + int newHeight, |
| + sk_sp<SkColorSpace> colorSpace) { |
| + // allocatePixelData() should only be called once |
|
Peter Kasting
2017/03/17 21:18:40
Nit: Trailing period
cblume
2017/03/17 21:41:16
Done.
|
| DCHECK(!width() && !height()); |
| m_bitmap.setInfo(SkImageInfo::MakeN32( |
| newWidth, newHeight, |
| m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType, |
| std::move(colorSpace))); |
| - if (!m_bitmap.tryAllocPixels(m_allocator, 0)) |
| - return false; |
| - |
| - zeroFillPixelData(); |
| - return true; |
| + return m_bitmap.tryAllocPixels(m_allocator, 0); |
| } |
| bool ImageFrame::hasAlpha() const { |