| Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| index 66bdaf2d16ea1d48b05b9b7981c9ff01e514ed9c..e1f5804c068f886da50a2f2a06dccb09a1989f6d 100644
|
| --- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| +++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| @@ -74,14 +74,23 @@ ImageBitmap* OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionSta
|
| return image;
|
| }
|
|
|
| -PassRefPtr<Image> OffscreenCanvas::getSourceImageForCanvas(SourceImageStatus* status, AccelerationHint hint, SnapshotReason reason, const FloatSize&) const
|
| +PassRefPtr<Image> OffscreenCanvas::getSourceImageForCanvas(SourceImageStatus* status, AccelerationHint hint, SnapshotReason reason, const FloatSize& size) const
|
| {
|
| if (!m_context) {
|
| *status = InvalidSourceImageStatus;
|
| return nullptr;
|
| }
|
| - *status = NormalSourceImageStatus;
|
| - return m_context->getImage(hint, reason);
|
| + if (!size.width() || !size.height()) {
|
| + *status = ZeroSizeCanvasSourceImageStatus;
|
| + return nullptr;
|
| + }
|
| + RefPtr<Image> image = m_context->getImage(hint, reason);
|
| + if (!image) {
|
| + *status = InvalidSourceImageStatus;
|
| + } else {
|
| + *status = NormalSourceImageStatus;
|
| + }
|
| + return image.release();
|
| }
|
|
|
| bool OffscreenCanvas::isOpaque() const
|
|
|