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 990fd97df9293e470145e6e37e5d0c9368ae8726..c87e3eb627e6bc5ac6d4830b2a9ca93db0cce713 100644 |
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| @@ -42,12 +42,6 @@ static inline IntRect normalizeRect(const IntRect& rect) |
| std::max(rect.height(), -rect.height())); |
| } |
| -static bool frameIsValid(const SkBitmap& frameBitmap) |
| -{ |
| - ASSERT(!frameBitmap.isNull() && !frameBitmap.empty() && frameBitmap.isImmutable()); |
| - return frameBitmap.colorType() == kN32_SkColorType; |
| -} |
| - |
| ParsedOptions parseOptions(const ImageBitmapOptions& options, Optional<IntRect> cropRect, IntSize sourceSize) |
| { |
| ParsedOptions parsedOptions; |
| @@ -180,10 +174,8 @@ PassRefPtr<SkImage> ImageBitmap::getSkImageFromDecoder(std::unique_ptr<ImageDeco |
| ImageFrame* frame = decoder->frameBufferAtIndex(0); |
| if (!frame || frame->getStatus() != ImageFrame::FrameComplete) |
| return nullptr; |
| - SkBitmap bitmap = frame->bitmap(); |
| - if (!frameIsValid(bitmap)) |
| - return nullptr; |
| - return fromSkSp(SkImage::MakeFromBitmap(bitmap)); |
| + DCHECK_EQ(frame->bitmap().colorType(), kN32_SkColorType); |
|
Peter Kasting
2016/08/30 06:59:40
The old code handled this conditionally, so this i
aleksandar.stojiljkovic
2016/09/21 20:56:57
Done. Didn't see how it could be different from kN
|
| + return frame->finalizePixelsAndGetImage(); |
| } |
| bool ImageBitmap::isResizeOptionValid(const ImageBitmapOptions& options, ExceptionState& exceptionState) |