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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 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: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index a4cf6dee2a14d274e7be11a4520aab3b9871ca3a..8e3cf9b4860a4c91c159b7f0aacf9a6aadba2f32 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -430,7 +430,7 @@ void HTMLCanvasElement::notifyListenersCanvasChanged()
}
-void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r)
+void HTMLCanvasElement::paint(GraphicsContext& context, const LayoutRect& r)
{
// FIXME: crbug.com/438240; there is a bug with the new CSS blending and compositing feature.
if (!m_context)
@@ -440,14 +440,14 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r)
m_context->paintRenderingResultsToCanvas(FrontBuffer);
if (hasImageBuffer()) {
- if (!context->contextDisabled()) {
+ if (!context.contextDisabled()) {
SkXfermode::Mode compositeOperator = !m_context || m_context->hasAlpha() ? SkXfermode::kSrcOver_Mode : SkXfermode::kSrc_Mode;
buffer()->draw(context, pixelSnappedIntRect(r), 0, compositeOperator);
}
} else {
// When alpha is false, we should draw to opaque black.
if (!m_context->hasAlpha())
- context->fillRect(FloatRect(r), Color(0, 0, 0));
+ context.fillRect(FloatRect(r), Color(0, 0, 0));
}
if (is3D() && paintsIntoCanvasBuffer())

Powered by Google App Engine
This is Rietveld 408576698