aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/fontmgr.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2016-11-04 16:26:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-07 15:22:49 +0000
commitcefc43112c8f6fe3702facb89447bdfcc2715345 (patch)
treec3e11ec30078b70ebe3af01d2e841dac572d1112 /gm/fontmgr.cpp
parent2db83612576d64935bd88747cf9855e79cad70d4 (diff)
gm: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4434 Change-Id: Ib2bea321617a17012190b33f2c7c439a5b6b3025 Reviewed-on: https://skia-review.googlesource.com/4434 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gm/fontmgr.cpp')
-rw-r--r--gm/fontmgr.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index 50b83836f2..216fdd8249 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -86,7 +86,7 @@ protected:
paint.setSubpixelText(true);
paint.setTextSize(17);
- SkFontMgr* fm = fFM;
+ SkFontMgr* fm = fFM.get();
int count = SkMin32(fm->countFamilies(), MAX_FAMILIES);
for (int i = 0; i < count; ++i) {
@@ -97,7 +97,7 @@ protected:
SkScalar x = 220;
- SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i));
+ sk_sp<SkFontStyleSet> set(fm->createStyleSet(i));
for (int j = 0; j < set->count(); ++j) {
SkString sname;
SkFontStyle fs;
@@ -118,13 +118,13 @@ protected:
}
private:
- SkAutoTUnref<SkFontMgr> fFM;
+ sk_sp<SkFontMgr> fFM;
SkString fName;
typedef GM INHERITED;
};
class FontMgrMatchGM : public skiagm::GM {
- SkAutoTUnref<SkFontMgr> fFM;
+ sk_sp<SkFontMgr> fFM;
public:
FontMgrMatchGM() : fFM(SkFontMgr::RefDefault()) {
@@ -192,7 +192,7 @@ protected:
"Helvetica Neue", "Arial"
};
- SkAutoTUnref<SkFontStyleSet> fset;
+ sk_sp<SkFontStyleSet> fset;
for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); ++i) {
fset.reset(fFM->matchFamily(gNames[i]));
if (fset->count() > 0) {
@@ -204,9 +204,9 @@ protected:
}
canvas->translate(20, 40);
- this->exploreFamily(canvas, paint, fset);
+ this->exploreFamily(canvas, paint, fset.get());
canvas->translate(150, 0);
- this->iterateFamily(canvas, paint, fset);
+ this->iterateFamily(canvas, paint, fset.get());
}
private:
@@ -263,7 +263,7 @@ protected:
const SkColor boundsColors[2] = { SK_ColorRED, SK_ColorBLUE };
- SkFontMgr* fm = fFM;
+ SkFontMgr* fm = fFM.get();
int count = SkMin32(fm->countFamilies(), 32);
int index = 0;
@@ -272,7 +272,7 @@ protected:
canvas->translate(80, 120);
for (int i = 0; i < count; ++i) {
- SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i));
+ sk_sp<SkFontStyleSet> set(fm->createStyleSet(i));
for (int j = 0; j < set->count(); ++j) {
paint.setTypeface(sk_sp<SkTypeface>(set->createTypeface(j)));
if (paint.getTypeface()) {
@@ -292,7 +292,7 @@ protected:
}
private:
- SkAutoTUnref<SkFontMgr> fFM;
+ sk_sp<SkFontMgr> fFM;
SkString fName;
SkScalar fScaleX, fSkewX;
typedef GM INHERITED;