bench, samples, etc: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4437
Change-Id: Ice071684ac8a99e4bb405b4b9be8e8f42c7bac42
Reviewed-on: https://skia-review.googlesource.com/4437
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/samplecode/SampleXfer.cpp b/samplecode/SampleXfer.cpp
index c0ad000..738541f 100644
--- a/samplecode/SampleXfer.cpp
+++ b/samplecode/SampleXfer.cpp
@@ -153,20 +153,20 @@
};
SkRect fModeRect[N_Modes];
- SkAutoTUnref<CircDrawable> fDrs[N];
+ sk_sp<CircDrawable> fDrs[N];
CircDrawable* fSelected;
void addButtons() {
SkScalar x = 10;
SkScalar y = 10;
for (int i = 0; i < N_Modes; ++i) {
- SkAutoTUnref<SkView> v(new PushButtonWig(gModes[i].fName, (int)gModes[i].fMode));
+ sk_sp<SkView> v(new PushButtonWig(gModes[i].fName, (int)gModes[i].fMode));
v->setSize(70, 25);
v->setLoc(x, y);
v->setVisibleP(true);
v->setEnabledP(true);
v->addListenerID(this->getSinkID());
- this->attachChildToFront(v);
+ this->attachChildToFront(v.get());
fModeRect[i] = SkRect::MakeXYWH(x, y + 28, 70, 2);
x += 80;
}
@@ -227,7 +227,7 @@
fSelected = nullptr;
for (int i = N - 1; i >= 0; --i) {
if (fDrs[i]->hitTest(x, y)) {
- fSelected = fDrs[i];
+ fSelected = fDrs[i].get();
break;
}
}