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

Unified Diff: third_party/WebKit/Source/core/paint/NinePieceImagePainter.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/NinePieceImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
index 402aed20b53aa622d3d1edf95f8ebac134add22d..5b8e6b99650bdb626405a7cf666475a23fc3e842 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
@@ -23,7 +23,7 @@ NinePieceImagePainter::NinePieceImagePainter(const LayoutBoxModelObject& layoutO
{
}
-bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const LayoutRect& rect, const ComputedStyle& style,
+bool NinePieceImagePainter::paint(GraphicsContext& graphicsContext, const LayoutRect& rect, const ComputedStyle& style,
const NinePieceImage& ninePieceImage, SkXfermode::Mode op) const
{
StyleImage* styleImage = ninePieceImage.image();
@@ -59,10 +59,9 @@ bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize, style.effectiveZoom());
- InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQuality(m_layoutObject,
- graphicsContext, image.get(), 0, rectWithOutsets.size());
- InterpolationQuality previousInterpolationQuality = graphicsContext->imageInterpolationQuality();
- graphicsContext->setImageInterpolationQuality(interpolationQuality);
+ InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQuality(m_layoutObject, image.get(), 0, rectWithOutsets.size());
+ InterpolationQuality previousInterpolationQuality = graphicsContext.imageInterpolationQuality();
+ graphicsContext.setImageInterpolationQuality(interpolationQuality);
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data",
InspectorPaintImageEvent::data(m_layoutObject, *styleImage));
@@ -72,16 +71,16 @@ bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
if (drawInfo.isDrawable) {
if (drawInfo.isCornerPiece) {
- graphicsContext->drawImage(image.get(), drawInfo.destination, drawInfo.source, op);
+ graphicsContext.drawImage(image.get(), drawInfo.destination, drawInfo.source, op);
} else {
- graphicsContext->drawTiledImage(image.get(), drawInfo.destination,
+ graphicsContext.drawTiledImage(image.get(), drawInfo.destination,
drawInfo.source, drawInfo.tileScale, drawInfo.tileRule.horizontal,
drawInfo.tileRule.vertical, op);
}
}
}
- graphicsContext->setImageInterpolationQuality(previousInterpolationQuality);
+ graphicsContext.setImageInterpolationQuality(previousInterpolationQuality);
return true;
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/NinePieceImagePainter.h ('k') | third_party/WebKit/Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698