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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 1789063005: Add sk_sp helpers and switch Blink SkShader clients to the new APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fromSkSp, review comments Created 4 years, 9 months 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/GraphicsContext.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index 55a6b12e4d89bba1f73ce4fa67fd90a69e2ca0c2..a6a00dde1ece5f9140253eeed9f6c5fb3add5de0 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -303,12 +303,12 @@ void GraphicsContext::beginRecording(const FloatRect& bounds)
skia::GetMetaData(*m_canvas) = m_metaData;
}
-PassRefPtr<const SkPicture> GraphicsContext::endRecording()
+PassRefPtr<SkPicture> GraphicsContext::endRecording()
{
if (contextDisabled())
return nullptr;
- RefPtr<const SkPicture> picture = adoptRef(m_pictureRecorder.endRecordingAsPicture());
+ RefPtr<SkPicture> picture = adoptRef(m_pictureRecorder.endRecordingAsPicture());
Stephen White 2016/03/18 14:48:27 Not related to this patch, but are there plans to
m_canvas = nullptr;
ASSERT(picture);
return picture.release();
@@ -635,11 +635,10 @@ void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float widt
SkMatrix localMatrix;
localMatrix.setTranslate(originX, originY);
- RefPtr<SkShader> shader = adoptRef(SkShader::CreateBitmapShader(
- *misspellBitmap[index], SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
SkPaint paint;
- paint.setShader(shader.get());
+ paint.setShader(SkShader::MakeBitmapShader(
+ *misspellBitmap[index], SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
SkRect rect;
rect.set(originX, originY, originX + WebCoreFloatToSkScalar(width) * deviceScaleFactor, originY + SkIntToScalar(misspellBitmap[index]->height()));

Powered by Google App Engine
This is Rietveld 408576698