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

Unified Diff: gm/imagesource2.cpp

Issue 1842243002: Update SkImageSource to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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
« no previous file with comments | « gm/imagesource.cpp ('k') | gm/offsetimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagesource2.cpp
diff --git a/gm/imagesource2.cpp b/gm/imagesource2.cpp
index 3a3d27360d8097728a46b2f46437ba4cb7ce24e5..ba6af46cfbd547bc4405ff259726ef35a1f33ff1 100644
--- a/gm/imagesource2.cpp
+++ b/gm/imagesource2.cpp
@@ -60,15 +60,13 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- SkRect srcRect = SkRect::MakeLTRB(0, 0,
- SkIntToScalar(kImageSize), SkIntToScalar(kImageSize));
- SkRect dstRect = SkRect::MakeLTRB(0.75f, 0.75f, 225.75f, 225.75f);
-
- SkAutoTUnref<SkImageFilter> filter(
- SkImageSource::Create(fImage.get(), srcRect, dstRect, fFilter));
+ const SkRect srcRect = SkRect::MakeLTRB(0, 0,
+ SkIntToScalar(kImageSize),
+ SkIntToScalar(kImageSize));
+ const SkRect dstRect = SkRect::MakeLTRB(0.75f, 0.75f, 225.75f, 225.75f);
SkPaint p;
- p.setImageFilter(filter);
+ p.setImageFilter(SkImageSource::Make(fImage, srcRect, dstRect, fFilter));
canvas->saveLayer(nullptr, &p);
canvas->restore();
« no previous file with comments | « gm/imagesource.cpp ('k') | gm/offsetimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698