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

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

Issue 389273002: Fix copyImage for WebGL elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: seperated negative test Created 6 years, 5 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
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index a8da6d7bd3d426c8ac8151fbf8e95ada0009ebc2..b7d7ea6041978e5d1772b67b313e4ea23605db30 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -592,8 +592,11 @@ void HTMLCanvasElement::ensureUnacceleratedImageBuffer()
Image* HTMLCanvasElement::copiedImage() const
{
if (!m_copiedImage && buffer()) {
- if (m_context)
+ if (m_context && m_context->is3d()) {
+ toWebGLRenderingContext(m_context.get())->setSavingImage(true);
m_context->paintRenderingResultsToCanvas();
+ toWebGLRenderingContext(m_context.get())->setSavingImage(false);
+ }
m_copiedImage = buffer()->copyImage(CopyBackingStore, Unscaled);
updateExternallyAllocatedMemory();
}

Powered by Google App Engine
This is Rietveld 408576698