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

Unified Diff: src/core/SkPictureShader.cpp

Issue 1778393002: add Make variations to return SkImage by sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: roll in fmalitas 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: src/core/SkPictureShader.cpp
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index c2a0b74e23b9e9199deacae402410daf75a9f4aa..30dc47ffd9ca4e279772604d6a06ddade82b6e91 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -93,7 +93,7 @@ struct BitmapShaderRec : public SkResourceCache::Rec {
} // namespace
-SkPictureShader::SkPictureShader(sk_sp<const SkPicture> picture, TileMode tmx, TileMode tmy,
+SkPictureShader::SkPictureShader(sk_sp<SkPicture> picture, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix, const SkRect* tile)
: INHERITED(localMatrix)
, fPicture(std::move(picture))
@@ -102,7 +102,7 @@ SkPictureShader::SkPictureShader(sk_sp<const SkPicture> picture, TileMode tmx, T
, fTmy(tmy) {
}
-sk_sp<SkShader> SkPictureShader::Make(sk_sp<const SkPicture> picture, TileMode tmx, TileMode tmy,
+sk_sp<SkShader> SkPictureShader::Make(sk_sp<SkPicture> picture, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix, const SkRect* tile) {
if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) {
return SkShader::MakeEmptyShader();
@@ -223,8 +223,8 @@ sk_sp<SkShader> SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, con
tileMatrix.setRectToRect(fTile, SkRect::MakeIWH(tileSize.width(), tileSize.height()),
SkMatrix::kFill_ScaleToFit);
- SkAutoTUnref<SkImage> tileImage(
- SkImage::NewFromPicture(fPicture.get(), tileSize, &tileMatrix, nullptr));
+ sk_sp<SkImage> tileImage(
+ SkImage::MakeFromPicture(fPicture, tileSize, &tileMatrix, nullptr));
if (!tileImage) {
return nullptr;
}
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/core/SkReadBuffer.cpp » ('j') | src/image/SkImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698