Index: Source/core/html/HTMLCanvasElement.cpp |
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp |
index 25fbe5b60f7e7363801255dd719ecd49b0350a31..0d43ffdd57a4f3c90b1adc82852ad70ebf97bfcd 100644 |
--- a/Source/core/html/HTMLCanvasElement.cpp |
+++ b/Source/core/html/HTMLCanvasElement.cpp |
@@ -49,6 +49,7 @@ |
#include "platform/graphics/GraphicsContextStateSaver.h" |
#include "platform/graphics/ImageBuffer.h" |
#include "platform/graphics/RecordingImageBufferSurface.h" |
+#include "platform/graphics/StaticBitmapImage.h" |
#include "platform/graphics/UnacceleratedImageBufferSurface.h" |
#include "platform/graphics/gpu/WebGLImageBufferSurface.h" |
#include "platform/transforms/AffineTransform.h" |
@@ -695,18 +696,17 @@ PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageMode mod |
return nullptr; |
} |
- if (mode == CopySourceImageIfVolatile) { |
- *status = NormalSourceImageStatus; |
- return copiedImage(); |
- } |
- |
if (m_context && m_context->is3d()) { |
m_context->paintRenderingResultsToCanvas(); |
*status = ExternalSourceImageStatus; |
+ |
+ // can't create SkImage from WebGLImageBufferSurface (contains only SkBitmap) |
+ return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); |
} else { |
*status = NormalSourceImageStatus; |
} |
- return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); |
+ |
+ return StaticBitmapImage::create(m_imageBuffer->newImageSnapshot()); |
} |
bool HTMLCanvasElement::wouldTaintOrigin(SecurityOrigin*) const |