Index: Source/core/html/HTMLCanvasElement.cpp |
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp |
index 8b0d798af50c69d4d865d79bbb35a37064fa7925..2af6357ee3c5723da4987014eac39bd764f150a7 100644 |
--- a/Source/core/html/HTMLCanvasElement.cpp |
+++ b/Source/core/html/HTMLCanvasElement.cpp |
@@ -375,10 +375,10 @@ String HTMLCanvasElement::toEncodingMimeType(const String& mimeType) |
const AtomicString HTMLCanvasElement::imageSourceURL() const |
{ |
- return AtomicString(toDataURLInternal("image/png", 0)); |
+ return AtomicString(toDataURLInternal("image/png", 0, true)); |
} |
-String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double* quality) const |
+String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double* quality, bool isSaving) const |
{ |
if (m_size.isEmpty() || !buffer()) |
return String("data:,"); |
@@ -391,8 +391,11 @@ String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double |
if (imageData) |
return ImageDataToDataURL(ImageDataBuffer(imageData->size(), imageData->data()), encodingMimeType, quality); |
- if (m_context) |
+ if (m_context && m_context->is3d()) { |
+ toWebGLRenderingContext(m_context.get())->setSavingImage(isSaving); |
m_context->paintRenderingResultsToCanvas(); |
+ toWebGLRenderingContext(m_context.get())->setSavingImage(false); |
+ } |
return buffer()->toDataURL(encodingMimeType, quality); |
} |