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

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

Issue 200003002: Canvas element that use the alpha attribute don't display correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: layout test Created 6 years, 9 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 | « LayoutTests/fast/canvas/alpha.js ('k') | no next file » | 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 4ea22121fa982da6aa7d0e3754e0d820cd904e05..a747a9fba20d8e34f9b44f7442102a9f666630af 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -315,6 +315,10 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r, boo
if (!paintsIntoCanvasBuffer() && !document().printing())
return;
m_context->paintRenderingResultsToCanvas();
+
+ // When alpha is false, we should initialize to opaque black.
+ if (!hasImageBuffer() && !m_context->hasAlpha())
+ createImageBuffer();
Justin Novosad 2014/03/17 17:24:23 I think you can solve this problem without creatin
}
if (hasImageBuffer()) {
« no previous file with comments | « LayoutTests/fast/canvas/alpha.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698