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

Side by Side Diff: ui/gfx/render_text_mac.mm

Issue 2271653006: base::mac::IsOSSierra() -> base::mac::IsOS10_12(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Nits Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/mac/scoped_cocoa_disable_screen_updates.h ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/render_text_mac.h" 5 #include "ui/gfx/render_text_mac.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <CoreText/CoreText.h> 9 #include <CoreText/CoreText.h>
10 10
(...skipping 11 matching lines...) Expand all
22 #include "third_party/skia/include/ports/SkTypeface_mac.h" 22 #include "third_party/skia/include/ports/SkTypeface_mac.h"
23 23
24 namespace { 24 namespace {
25 25
26 // This function makes a copy of |font| with the given symbolic traits. On OSX 26 // This function makes a copy of |font| with the given symbolic traits. On OSX
27 // 10.11, CTFontCreateCopyWithSymbolicTraits has the right behavior but 27 // 10.11, CTFontCreateCopyWithSymbolicTraits has the right behavior but
28 // CTFontCreateWithFontDescriptor does not. The opposite holds true for OSX 28 // CTFontCreateWithFontDescriptor does not. The opposite holds true for OSX
29 // 10.10. 29 // 10.10.
30 base::ScopedCFTypeRef<CTFontRef> CopyFontWithSymbolicTraits(CTFontRef font, 30 base::ScopedCFTypeRef<CTFontRef> CopyFontWithSymbolicTraits(CTFontRef font,
31 int sym_traits) { 31 int sym_traits) {
32 if (base::mac::IsOSElCapitanOrLater()) { 32 if (base::mac::IsAtLeastOS10_11()) {
33 return base::ScopedCFTypeRef<CTFontRef>(CTFontCreateCopyWithSymbolicTraits( 33 return base::ScopedCFTypeRef<CTFontRef>(CTFontCreateCopyWithSymbolicTraits(
34 font, 0, nullptr, sym_traits, sym_traits)); 34 font, 0, nullptr, sym_traits, sym_traits));
35 } 35 }
36 36
37 base::ScopedCFTypeRef<CTFontDescriptorRef> orig_desc( 37 base::ScopedCFTypeRef<CTFontDescriptorRef> orig_desc(
38 CTFontCopyFontDescriptor(font)); 38 CTFontCopyFontDescriptor(font));
39 base::ScopedCFTypeRef<CFDictionaryRef> orig_attributes( 39 base::ScopedCFTypeRef<CFDictionaryRef> orig_attributes(
40 CTFontDescriptorCopyAttributes(orig_desc)); 40 CTFontDescriptorCopyAttributes(orig_desc));
41 // Make a mutable copy of orig_attributes. 41 // Make a mutable copy of orig_attributes.
42 base::ScopedCFTypeRef<CFMutableDictionaryRef> attributes( 42 base::ScopedCFTypeRef<CFMutableDictionaryRef> attributes(
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 442 }
443 443
444 void RenderTextMac::InvalidateStyle() { 444 void RenderTextMac::InvalidateStyle() {
445 line_.reset(); 445 line_.reset();
446 attributes_.reset(); 446 attributes_.reset();
447 runs_.clear(); 447 runs_.clear();
448 runs_valid_ = false; 448 runs_valid_ = false;
449 } 449 }
450 450
451 } // namespace gfx 451 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/mac/scoped_cocoa_disable_screen_updates.h ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698