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

Unified Diff: gm/displacement.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/bigtileimagefilter.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/displacement.cpp
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index a3fb9e5e5b9d1757dcdca04499caa9d63abd92b2..9b62a60ab3ee86f957b6da8ae68d7b1ef2672048 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -57,133 +57,133 @@ protected:
void onDraw(SkCanvas* canvas) override {
canvas->clear(SK_ColorBLACK);
SkPaint paint;
- SkAutoTUnref<SkImageFilter> displ(SkImageSource::Create(fCheckerboard.get()));
+ sk_sp<SkImageFilter> displ(SkImageSource::Make(fCheckerboard));
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ))->unref();
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 0, 0, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 100, 0, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ))->unref();
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 200, 0, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 300, 0, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 400, 0, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ))->unref();
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 0, 100, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 100, 100, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ))->unref();
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 200, 100, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 300, 100, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref();
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 400, 100, paint);
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(30, 30, 40, 40));
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kG_ChannelSelectorType,
- 0.0f, displ, nullptr, &cropRect))->unref();
+ 0.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 0, 200, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kB_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 16.0f, displ, nullptr, &cropRect))->unref();
+ 16.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 100, 200, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kB_ChannelSelectorType,
- 32.0f, displ, nullptr, &cropRect))->unref();
+ 32.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 200, 200, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 48.0f, displ, nullptr, &cropRect))->unref();
+ 48.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 300, 200, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 64.0f, displ, nullptr, &cropRect))->unref();
+ 64.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 400, 200, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kG_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect))->unref();
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 0, 300, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kB_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect))->unref();
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 100, 300, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kB_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect))->unref();
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 200, 300, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect))->unref();
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 300, 300, paint);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect))->unref();
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 400, 300, paint);
// Test for negative scale.
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- -40.0f, displ))->unref();
+ -40.0f, displ.get()))->unref();
this->drawClippedBitmap(canvas, 500, 0, paint);
// Tests for images of different sizes
- displ.reset(SkImageSource::Create(fSmall.get()));
+ displ = SkImageSource::Make(fSmall);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kG_ChannelSelectorType,
- 40.0f, displ))->unref();
+ 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 0, 400, paint);
- displ.reset(SkImageSource::Create(fLarge.get()));
+ displ = SkImageSource::Make(fLarge);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kB_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ))->unref();
+ 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 100, 400, paint);
- displ.reset(SkImageSource::Create(fLargeW.get()));
+ displ = SkImageSource::Make(fLargeW);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
SkDisplacementMapEffect::kB_ChannelSelectorType,
- 40.0f, displ))->unref();
+ 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 200, 400, paint);
- displ.reset(SkImageSource::Create(fLargeH.get()));
+ displ = SkImageSource::Make(fLargeH);
paint.setImageFilter(SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kG_ChannelSelectorType,
SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ))->unref();
+ 40.0f, displ.get()))->unref();
drawClippedBitmap(canvas, 300, 400, paint);
// Test for no given displacement input. In this case, both displacement
« no previous file with comments | « gm/bigtileimagefilter.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698