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

Unified Diff: ui/gfx/render_text_mac.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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 | « ui/gfx/render_text_mac.h ('k') | ui/shell_dialogs/select_file_dialog_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_mac.cc
diff --git a/ui/gfx/render_text_mac.cc b/ui/gfx/render_text_mac.cc
index 67a547d182ae3d2cd8e1b3c8f5437e52ef62576b..f6a1b78c432459d585a54990873edd5460eebe0e 100644
--- a/ui/gfx/render_text_mac.cc
+++ b/ui/gfx/render_text_mac.cc
@@ -107,22 +107,26 @@ void RenderTextMac::EnsureLayout() {
runs_valid_ = false;
const Font& font = GetFont();
- base::mac::ScopedCFTypeRef<CFStringRef> font_name_cf_string(
+ base::ScopedCFTypeRef<CFStringRef> font_name_cf_string(
base::SysUTF8ToCFStringRef(font.GetFontName()));
- base::mac::ScopedCFTypeRef<CTFontRef> ct_font(
+ base::ScopedCFTypeRef<CTFontRef> ct_font(
CTFontCreateWithName(font_name_cf_string, font.GetFontSize(), NULL));
const void* keys[] = { kCTFontAttributeName };
const void* values[] = { ct_font };
- base::mac::ScopedCFTypeRef<CFDictionaryRef> attributes(
- CFDictionaryCreate(NULL, keys, values, arraysize(keys), NULL,
+ base::ScopedCFTypeRef<CFDictionaryRef> attributes(
+ CFDictionaryCreate(NULL,
+ keys,
+ values,
+ arraysize(keys),
+ NULL,
&kCFTypeDictionaryValueCallBacks));
- base::mac::ScopedCFTypeRef<CFStringRef> cf_text(
+ base::ScopedCFTypeRef<CFStringRef> cf_text(
base::SysUTF16ToCFStringRef(text()));
- base::mac::ScopedCFTypeRef<CFAttributedStringRef> attr_text(
+ base::ScopedCFTypeRef<CFAttributedStringRef> attr_text(
CFAttributedStringCreate(NULL, cf_text, attributes));
- base::mac::ScopedCFTypeRef<CFMutableAttributedStringRef> attr_text_mutable(
+ base::ScopedCFTypeRef<CFMutableAttributedStringRef> attr_text_mutable(
CFAttributedStringCreateMutableCopy(NULL, 0, attr_text));
// TODO(asvitkine|msw): Respect GetTextDirection(), which may not match the
@@ -193,7 +197,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
for (size_t i = 0, end = 0; i < layout_text_length; i = end) {
end = TextIndexToLayoutIndex(style.GetRange().end());
const CFRange range = CFRangeMake(i, end - i);
- base::mac::ScopedCFTypeRef<CGColorRef> foreground(
+ base::ScopedCFTypeRef<CGColorRef> foreground(
gfx::CGColorCreateFromSkColor(style.color()));
CFAttributedStringSetAttribute(attr_string, range,
kCTForegroundColorAttributeName, foreground);
@@ -201,7 +205,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
if (style.style(UNDERLINE)) {
CTUnderlineStyle value = kCTUnderlineStyleSingle;
- base::mac::ScopedCFTypeRef<CFNumberRef> underline_value(
+ base::ScopedCFTypeRef<CFNumberRef> underline_value(
CFNumberCreate(NULL, kCFNumberSInt32Type, &value));
CFAttributedStringSetAttribute(attr_string, range,
kCTUnderlineStyleAttributeName,
@@ -212,7 +216,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
const int traits = (style.style(BOLD) ? kCTFontBoldTrait : 0) |
(style.style(ITALIC) ? kCTFontItalicTrait : 0);
if (traits != 0) {
- base::mac::ScopedCFTypeRef<CTFontRef> styled_font(
+ base::ScopedCFTypeRef<CTFontRef> styled_font(
CTFontCreateCopyWithSymbolicTraits(font, 0.0, NULL, traits, traits));
// TODO(asvitkine): Handle |styled_font| == NULL case better.
if (styled_font) {
@@ -293,7 +297,7 @@ void RenderTextMac::ComputeRuns() {
CTFontRef ct_font =
base::mac::GetValueFromDictionary<CTFontRef>(attributes,
kCTFontAttributeName);
- base::mac::ScopedCFTypeRef<CFStringRef> font_name_ref(
+ base::ScopedCFTypeRef<CFStringRef> font_name_ref(
CTFontCopyFamilyName(ct_font));
run->font_name = base::SysCFStringRefToUTF8(font_name_ref);
run->text_size = CTFontGetSize(ct_font);
« no previous file with comments | « ui/gfx/render_text_mac.h ('k') | ui/shell_dialogs/select_file_dialog_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698