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

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) 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 | « src/pdf/SkPDFStream.cpp ('k') | src/ports/SkFontMgr_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index f1724b675b4a06c38e2bbfedbec128a62b50b620..69f660c8f1554c1626d0780e28a98888248a619c 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -105,7 +105,7 @@ public:
}
}
- CFRef detach() {
+ CFRef release() {
CFRef self = fCFRef;
fCFRef = nullptr;
return self;
@@ -550,7 +550,7 @@ static SkTypeface* NewFromName(const char familyName[], const SkFontStyle& theSt
SkTypeface* face = SkTypefaceCache::FindByProcAndRef(find_by_CTFontRef, (void*)ctFont.get());
if (!face) {
- face = NewFromFontRef(ctFont.detach(), nullptr, nullptr, false);
+ face = NewFromFontRef(ctFont.release(), nullptr, nullptr, false);
SkTypefaceCache::Add(face, face->fontStyle());
}
return face;
@@ -1867,9 +1867,9 @@ SkFontData* SkTypeface_Mac::onCreateFontData() const {
CFIndex cgAxisCount;
SkAutoSTMalloc<4, SkFixed> axisValues;
if (get_variations(fFontRef, &cgAxisCount, &axisValues)) {
- return new SkFontData(stream.detach(), index, axisValues.get(), cgAxisCount);
+ return new SkFontData(stream.release(), index, axisValues.get(), cgAxisCount);
}
- return new SkFontData(stream.detach(), index, nullptr, 0);
+ return new SkFontData(stream.release(), index, nullptr, 0);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2199,7 +2199,7 @@ static SkTypeface* createFromDesc(CFStringRef cfFamilyName, CTFontDescriptorRef
bool isFixedPitch;
(void)computeStyleBits(ctFont, &isFixedPitch);
- face = new SkTypeface_Mac(ctFont.detach(), nullptr, cacheRequest.fStyle, isFixedPitch,
+ face = new SkTypeface_Mac(ctFont.release(), nullptr, cacheRequest.fStyle, isFixedPitch,
skFamilyName.c_str(), false);
SkTypefaceCache::Add(face, face->fontStyle());
return face;
@@ -2497,14 +2497,14 @@ protected:
if (cgVariations) {
cgVariant.reset(CGFontCreateCopyWithVariations(cg, cgVariations));
} else {
- cgVariant.reset(cg.detach());
+ cgVariant.reset(cg.release());
}
CTFontRef ct = CTFontCreateWithGraphicsFont(cgVariant, 0, nullptr, nullptr);
if (!ct) {
return nullptr;
}
- return NewFromFontRef(ct, cg.detach(), nullptr, true);
+ return NewFromFontRef(ct, cg.release(), nullptr, true);
}
static CFDictionaryRef get_axes(CGFontRef cg, SkFontData* fontData) {
@@ -2580,14 +2580,14 @@ protected:
if (cgVariations) {
cgVariant.reset(CGFontCreateCopyWithVariations(cg, cgVariations));
} else {
- cgVariant.reset(cg.detach());
+ cgVariant.reset(cg.release());
}
CTFontRef ct = CTFontCreateWithGraphicsFont(cgVariant, 0, nullptr, nullptr);
if (!ct) {
return nullptr;
}
- return NewFromFontRef(ct, cg.detach(), nullptr, true);
+ return NewFromFontRef(ct, cg.release(), nullptr, true);
}
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
« no previous file with comments | « src/pdf/SkPDFStream.cpp ('k') | src/ports/SkFontMgr_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698