Index: gm/imagescalealigned.cpp |
diff --git a/gm/imagescalealigned.cpp b/gm/imagescalealigned.cpp |
index c9e697cbadf88245514232808065b84fb15c7107..66ad8b62f4b16c953f05be744c7bd44ecb865d4f 100644 |
--- a/gm/imagescalealigned.cpp |
+++ b/gm/imagescalealigned.cpp |
@@ -20,11 +20,11 @@ protected: |
auto& set = fSets.push_back(); |
set.fVector = vectors[i]; |
- set.fImages.push_back().reset(MakeImage(vectors[i], SK_ColorGREEN)); |
+ set.fImages.push_back() = MakeImage(vectors[i], SK_ColorGREEN); |
set.fScales.push_back() = 1; |
- set.fImages.push_back().reset(MakeImage(vectors[i], SK_ColorRED)); |
+ set.fImages.push_back() = MakeImage(vectors[i], SK_ColorRED); |
set.fScales.push_back() = kStretchFactor; |
- set.fImages.push_back().reset(MakeImage(vectors[i], SK_ColorGREEN)); |
+ set.fImages.push_back() = MakeImage(vectors[i], SK_ColorGREEN); |
set.fScales.push_back() = 1; |
} |
} |
@@ -63,12 +63,12 @@ protected: |
private: |
struct ImageSet { |
- SkSTArray<3, SkAutoTUnref<SkImage>, true> fImages; |
- SkSTArray<3, SkScalar> fScales; |
- SkVector fVector; |
+ SkSTArray<3, sk_sp<SkImage>, true> fImages; |
+ SkSTArray<3, SkScalar> fScales; |
+ SkVector fVector; |
}; |
- static SkImage* MakeImage(const SkVector& vec, SkColor color) { |
+ static sk_sp<SkImage> MakeImage(const SkVector& vec, SkColor color) { |
const SkPoint start = SkPoint::Make(vec.y() * kSegLen / 2, vec.x() * kSegLen / 2); |
const SkPoint end = SkPoint::Make(start.x() + vec.x() * (kSegLen - 1), |
start.y() + vec.y() * (kSegLen - 1)); |
@@ -88,7 +88,7 @@ private: |
surface->getCanvas()->drawPoint(start.x(), start.y(), color); |
surface->getCanvas()->drawPoint(end.x(), end.y(), color); |
- return surface->newImageSnapshot(); |
+ return surface->makeImageSnapshot(); |
} |
void drawSets(SkCanvas* canvas) const { |
@@ -131,7 +131,7 @@ private: |
img->width() * (1 + (set.fScales[i] - 1) * set.fVector.x()), |
img->height() * (1 + (set.fScales[i] - 1) * set.fVector.y())); |
- canvas->drawImageRect(img, dst, &paint); |
+ canvas->drawImageRect(img.get(), dst, &paint); |
pt.offset(dst.width() * set.fVector.x(), dst.height() * set.fVector.y()); |
} |