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

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

Issue 766333003: canvas: fix bugs on HTMLCanvasElement::copiedImage() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rephrase this test so that the expectations don't contain failure Created 6 years 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 c973b76cc16dc14a910240b61cf98b8e403e03e8..8a2362ddd68498a68a043214f86143564d8cb626 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -737,9 +737,11 @@ PassRefPtr<Image> HTMLCanvasElement::copiedImage(SourceDrawingBuffer sourceBuffe
if (!m_context)
return createTransparentImage(size());
- if (!m_copiedImage && buffer()) {
- if (m_context && m_context->is3d())
- m_context->paintRenderingResultsToCanvas(sourceBuffer);
+ bool needToUpdate = !m_copiedImage;
+ // The concept of SourceDrawingBuffer is valid on only WebGL.
+ if (m_context->is3d())
+ needToUpdate |= m_context->paintRenderingResultsToCanvas(sourceBuffer);
+ if (needToUpdate && buffer()) {
m_copiedImage = buffer()->copyImage(CopyBackingStore, Unscaled);
updateExternallyAllocatedMemory();
}
« no previous file with comments | « LayoutTests/fast/canvas/canvas-createImageBitmap-webgl-expected.txt ('k') | Source/core/html/canvas/CanvasRenderingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698