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

Unified Diff: third_party/WebKit/Source/core/paint/HTMLCanvasPainter.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/paint/HTMLCanvasPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/HTMLCanvasPainter.cpp b/third_party/WebKit/Source/core/paint/HTMLCanvasPainter.cpp
index 46b440a5a866b9e98b8b563344bf416f095cfaa2..648fa21a5429b164f8e81dd6c98d1c6b92bce140 100644
--- a/third_party/WebKit/Source/core/paint/HTMLCanvasPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/HTMLCanvasPainter.cpp
@@ -16,8 +16,8 @@ namespace blink {
void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- GraphicsContext* context = paintInfo.context;
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutHTMLCanvas, paintInfo.phase, paintOffset))
+ GraphicsContext& context = paintInfo.context;
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutHTMLCanvas, paintInfo.phase, paintOffset))
return;
LayoutRect contentRect = m_layoutHTMLCanvas.contentBoxRect();
@@ -25,7 +25,7 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
LayoutRect paintRect = m_layoutHTMLCanvas.replacedContentRect();
paintRect.moveBy(paintOffset);
- LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutHTMLCanvas, paintInfo.phase, contentRect, paintOffset);
+ LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutHTMLCanvas, paintInfo.phase, contentRect, paintOffset);
#if ENABLE(ASSERT)
// The drawing may be in display list mode or image mode, producing different pictures for the same result.
drawingRecorder.setUnderInvalidationCheckingMode(DrawingDisplayItem::CheckBitmap);
@@ -33,9 +33,9 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
bool clip = !contentRect.contains(paintRect);
if (clip) {
- context->save();
+ context.save();
// TODO(chrishtr): this should be pixel-snapped.
- context->clip(FloatRect(contentRect));
+ context.clip(FloatRect(contentRect));
}
// FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set.
@@ -44,13 +44,13 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
if (m_layoutHTMLCanvas.style()->imageRendering() == ImageRenderingPixelated)
interpolationQuality = InterpolationNone;
- InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
- context->setImageInterpolationQuality(interpolationQuality);
+ InterpolationQuality previousInterpolationQuality = context.imageInterpolationQuality();
+ context.setImageInterpolationQuality(interpolationQuality);
toHTMLCanvasElement(m_layoutHTMLCanvas.node())->paint(context, paintRect);
- context->setImageInterpolationQuality(previousInterpolationQuality);
+ context.setImageInterpolationQuality(previousInterpolationQuality);
if (clip)
- context->restore();
+ context.restore();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/FrameSetPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ImagePainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698