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

Unified Diff: third_party/WebKit/Source/platform/graphics/GeneratedImage.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/platform/graphics/GeneratedImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
index aec9957e7f77f137802122e39c81d034a25fc8f1..66dc39257f09b53fde9e9579e1664985be9094e0 100644
--- a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
@@ -44,16 +44,16 @@ void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length&
intrinsicRatio = FloatSize();
}
-void GeneratedImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const FloatSize& scale,
+void GeneratedImage::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const FloatSize& scale,
const FloatPoint& phase, SkXfermode::Mode compositeOp, const FloatRect& destRect,
const FloatSize& repeatSpacing)
{
FloatRect tileRect = srcRect;
tileRect.expand(FloatSize(repeatSpacing));
- SkPictureBuilder builder(tileRect, nullptr, destContext);
+ SkPictureBuilder builder(tileRect, nullptr, &destContext);
builder.context().beginRecording(tileRect);
- drawTile(&builder.context(), srcRect);
+ drawTile(builder.context(), srcRect);
RefPtr<const SkPicture> tilePicture = builder.endRecording();
AffineTransform patternTransform;
@@ -64,12 +64,12 @@ void GeneratedImage::drawPattern(GraphicsContext* destContext, const FloatRect&
RefPtr<Pattern> picturePattern = Pattern::createPicturePattern(tilePicture);
picturePattern->setPatternSpaceTransform(patternTransform);
- SkPaint fillPaint = destContext->fillPaint();
+ SkPaint fillPaint = destContext.fillPaint();
picturePattern->applyToPaint(fillPaint);
fillPaint.setColor(SK_ColorBLACK);
fillPaint.setXfermodeMode(compositeOp);
- destContext->drawRect(destRect, fillPaint);
+ destContext.drawRect(destRect, fillPaint);
}
PassRefPtr<SkImage> GeneratedImage::imageForCurrentFrame()

Powered by Google App Engine
This is Rietveld 408576698