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

Unified Diff: third_party/WebKit/Source/core/paint/EmbeddedObjectPainter.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/EmbeddedObjectPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/EmbeddedObjectPainter.cpp b/third_party/WebKit/Source/core/paint/EmbeddedObjectPainter.cpp
index 119832b4ff7f9aa546f4729a28cc48e5bacf6928..3b60bca99b623ffd24f4b547d3f4e145404b5a2b 100644
--- a/third_party/WebKit/Source/core/paint/EmbeddedObjectPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/EmbeddedObjectPainter.cpp
@@ -43,15 +43,15 @@ void EmbeddedObjectPainter::paintReplaced(const PaintInfo& paintInfo, const Layo
if (paintInfo.phase == PaintPhaseSelection)
return;
- GraphicsContext* context = paintInfo.context;
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutEmbeddedObject, paintInfo.phase, paintOffset))
+ GraphicsContext& context = paintInfo.context;
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutEmbeddedObject, paintInfo.phase, paintOffset))
return;
LayoutRect contentRect(m_layoutEmbeddedObject.contentBoxRect());
contentRect.moveBy(paintOffset);
- LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutEmbeddedObject, paintInfo.phase, contentRect, paintOffset);
- GraphicsContextStateSaver stateSaver(*context);
- context->clip(pixelSnappedIntRect(contentRect));
+ LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutEmbeddedObject, paintInfo.phase, contentRect, paintOffset);
+ GraphicsContextStateSaver stateSaver(context);
+ context.clip(pixelSnappedIntRect(contentRect));
Font font = replacementTextFont();
// TODO(trchen): Speculative fix for crbug.com/481880
@@ -68,15 +68,15 @@ void EmbeddedObjectPainter::paintReplaced(const PaintInfo& paintInfo, const Layo
Path roundedBackgroundRect;
FloatRect floatBackgroundRect(backgroundRect);
roundedBackgroundRect.addRoundedRect(floatBackgroundRect, FloatSize(replacementTextRoundedRectRadius, replacementTextRoundedRectRadius));
- context->setFillColor(scaleAlpha(Color::white, replacementTextRoundedRectOpacity));
- context->fillPath(roundedBackgroundRect);
+ context.setFillColor(scaleAlpha(Color::white, replacementTextRoundedRectOpacity));
+ context.fillPath(roundedBackgroundRect);
FloatRect textRect(FloatPoint(), textGeometry);
textRect.move(FloatPoint(contentRect.center()) - textRect.center());
TextRunPaintInfo runInfo(textRun);
runInfo.bounds = floatBackgroundRect;
- context->setFillColor(scaleAlpha(Color::black, replacementTextTextOpacity));
- context->drawBidiText(font, runInfo, textRect.location() + FloatSize(0, font.fontMetrics().ascent()));
+ context.setFillColor(scaleAlpha(Color::black, replacementTextTextOpacity));
+ context.drawBidiText(font, runInfo, textRect.location() + FloatSize(0, font.fontMetrics().ascent()));
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/EllipsisBoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/FieldsetPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698