Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 309933004: Fix imageSourceURL() for WebGL elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698