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

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

Issue 1786183002: Revert of Switch Blink SkShader clients to sk_sp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ImagePattern.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
index a11609e81d670e9b060dd051b404db78b85ec5e7..32f4aa92910d0cbfee0cbbb372ef28af52f425e3 100644
--- a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
@@ -30,16 +30,16 @@
}
}
-sk_sp<SkShader> ImagePattern::createShader()
+PassRefPtr<SkShader> ImagePattern::createShader()
{
if (!m_tileImage)
- return SkShader::MakeColorShader(SK_ColorTRANSPARENT);
+ return adoptRef(SkShader::CreateColorShader(SK_ColorTRANSPARENT));
SkMatrix localMatrix = affineTransformToSkMatrix(m_patternSpaceTransformation);
if (isRepeatXY()) {
// Fast path: for repeatXY we just return a shader from the original image.
- return sk_sp<SkShader>(m_tileImage->newShader(SkShader::kRepeat_TileMode,
+ return adoptRef(m_tileImage->newShader(SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode, &localMatrix));
}
@@ -61,7 +61,7 @@
RefPtr<SkSurface> surface = adoptRef(SkSurface::NewRasterN32Premul(
m_tileImage->width() + expandW, m_tileImage->height() + expandH));
if (!surface)
- return SkShader::MakeColorShader(SK_ColorTRANSPARENT);
+ return adoptRef(SkShader::CreateColorShader(SK_ColorTRANSPARENT));
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
SkPaint paint;
@@ -69,7 +69,7 @@
surface->getCanvas()->drawImage(m_tileImage.get(), 0, 0, &paint);
RefPtr<SkImage> expandedImage = adoptRef(surface->newImageSnapshot());
- return sk_sp<SkShader>(expandedImage->newShader(tileModeX, tileModeY, &localMatrix));
+ return adoptRef(expandedImage->newShader(tileModeX, tileModeY, &localMatrix));
}
bool ImagePattern::isTextureBacked() const
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/ImagePattern.h ('k') | third_party/WebKit/Source/platform/graphics/Pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698