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

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: rebase Created 6 years, 8 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 d6f0566040625389845326fd41e6def0605ba1f6..54f25ea62e6ae151385ddb556821a6cb4390dd09 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -326,6 +326,10 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r)
else
context->drawImageBuffer(imageBuffer, pixelSnappedIntRect(r), compositeOperator, blink::WebBlendModeNormal);
}
+ } else {
+ // When alpha is false, we should draw to opaque black.
+ if (m_context && !m_context->hasAlpha())
+ context->fillRect(FloatRect(0, 0, width(), height()), Color(0, 0, 0));
}
if (is3D())
« 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