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

Unified Diff: gm/bigtileimagefilter.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 | « bench/MergeBench.cpp ('k') | gm/displacement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bigtileimagefilter.cpp
diff --git a/gm/bigtileimagefilter.cpp b/gm/bigtileimagefilter.cpp
index 7d3d3afeedf25b522a83f45ce57e83e17eddf7aa..5c12f94ea01d2c447deb4ca2d021f7f867329864 100644
--- a/gm/bigtileimagefilter.cpp
+++ b/gm/bigtileimagefilter.cpp
@@ -54,13 +54,15 @@ protected:
{
SkPaint p;
- SkRect bound = SkRect::MakeWH(SkIntToScalar(kWidth), SkIntToScalar(kHeight));
- sk_sp<SkImageFilter> imageSource(SkImageSource::Create(fRedImage.get()));
- SkAutoTUnref<SkImageFilter> tif(SkTileImageFilter::Create(
- SkRect::MakeWH(SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize)),
- SkRect::MakeWH(SkIntToScalar(kWidth), SkIntToScalar(kHeight)),
- imageSource.get()));
- p.setImageFilter(tif);
+ const SkRect bound = SkRect::MakeIWH(kWidth, kHeight);
+ sk_sp<SkImageFilter> imageSource(SkImageSource::Make(fRedImage));
+
+ sk_sp<SkImageFilter> tif(SkTileImageFilter::Create(
+ SkRect::MakeIWH(kBitmapSize, kBitmapSize),
+ SkRect::MakeIWH(kWidth, kHeight),
+ imageSource.get()));
+
+ p.setImageFilter(std::move(tif));
canvas->saveLayer(&bound, &p);
canvas->restore();
@@ -69,13 +71,14 @@ protected:
{
SkPaint p2;
- SkRect bound2 = SkRect::MakeWH(SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize));
+ const SkRect bound2 = SkRect::MakeIWH(kBitmapSize, kBitmapSize);
+
+ sk_sp<SkImageFilter> tif(SkTileImageFilter::Create(
+ SkRect::MakeIWH(kBitmapSize, kBitmapSize),
+ SkRect::MakeIWH(kBitmapSize, kBitmapSize),
+ nullptr));
- SkAutoTUnref<SkImageFilter> tif2(SkTileImageFilter::Create(
- SkRect::MakeWH(SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize)),
- SkRect::MakeWH(SkIntToScalar(kBitmapSize), SkIntToScalar(kBitmapSize)),
- nullptr));
- p2.setImageFilter(tif2);
+ p2.setImageFilter(std::move(tif));
canvas->translate(320, 320);
canvas->saveLayer(&bound2, &p2);
« no previous file with comments | « bench/MergeBench.cpp ('k') | gm/displacement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698