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

Unified Diff: third_party/WebKit/Source/core/paint/SVGImagePainter.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/SVGImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp b/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
index fec17f72e67ea3e15047f5894ccbece6e66dd19b..dcb8e82cf4c67e8765718bed4a3f9be2edc68b14 100644
--- a/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGImagePainter.cpp
@@ -33,11 +33,11 @@ void SVGImagePainter::paint(const PaintInfo& paintInfo)
PaintInfo paintInfoBeforeFiltering(paintInfo);
// Images cannot have children so do not call updateCullRect.
- TransformRecorder transformRecorder(*paintInfoBeforeFiltering.context, m_layoutSVGImage, m_layoutSVGImage.localToParentTransform());
+ TransformRecorder transformRecorder(paintInfoBeforeFiltering.context, m_layoutSVGImage, m_layoutSVGImage.localToParentTransform());
{
SVGPaintContext paintContext(m_layoutSVGImage, paintInfoBeforeFiltering);
- if (paintContext.applyClipMaskAndFilterIfNecessary() && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintContext.paintInfo().context, m_layoutSVGImage, paintContext.paintInfo().phase, LayoutPoint())) {
- LayoutObjectDrawingRecorder recorder(*paintContext.paintInfo().context, m_layoutSVGImage, paintContext.paintInfo().phase, boundingBox, LayoutPoint());
+ if (paintContext.applyClipMaskAndFilterIfNecessary() && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintContext.paintInfo().context, m_layoutSVGImage, paintContext.paintInfo().phase, LayoutPoint())) {
+ LayoutObjectDrawingRecorder recorder(paintContext.paintInfo().context, m_layoutSVGImage, paintContext.paintInfo().phase, boundingBox, LayoutPoint());
paintForeground(paintContext.paintInfo());
}
}
@@ -64,12 +64,12 @@ void SVGImagePainter::paintForeground(const PaintInfo& paintInfo)
imageElement->preserveAspectRatio()->currentValue()->transformRect(destRect, srcRect);
InterpolationQuality interpolationQuality = InterpolationDefault;
- interpolationQuality = ImageQualityController::imageQualityController()->chooseInterpolationQuality(paintInfo.context, &m_layoutSVGImage, image.get(), image.get(), LayoutSize(destRect.size()));
+ interpolationQuality = ImageQualityController::imageQualityController()->chooseInterpolationQuality(m_layoutSVGImage, image.get(), image.get(), LayoutSize(destRect.size()));
- InterpolationQuality previousInterpolationQuality = paintInfo.context->imageInterpolationQuality();
- paintInfo.context->setImageInterpolationQuality(interpolationQuality);
- paintInfo.context->drawImage(image.get(), destRect, srcRect, SkXfermode::kSrcOver_Mode);
- paintInfo.context->setImageInterpolationQuality(previousInterpolationQuality);
+ InterpolationQuality previousInterpolationQuality = paintInfo.context.imageInterpolationQuality();
+ paintInfo.context.setImageInterpolationQuality(interpolationQuality);
+ paintInfo.context.drawImage(image.get(), destRect, srcRect, SkXfermode::kSrcOver_Mode);
+ paintInfo.context.setImageInterpolationQuality(previousInterpolationQuality);
}
FloatSize SVGImagePainter::computeImageViewportSize() const

Powered by Google App Engine
This is Rietveld 408576698