Commit a6222c50 authored by bartfab@chromium.org's avatar bartfab@chromium.org

Revert 289403 "Update iOS deployment target to 7.0"

This appears to have broken gfx_unittests on iOS:

http://build.chromium.org/p/chromium.mac/builders/iOS%20Simulator%20%28dbg%29/builds/17689

> Update iOS deployment target to 7.0
> 
> iOS 6 will no longer be supported.
> 
> Replaces deprecated sizeWithFont: with sizeWithAttributes: (adding a
> ceilf since according to the internet, the former rounds up, and the
> latter does not) to fix compilation.
> 
> BUG=402921
> 
> Review URL: https://codereview.chromium.org/463333002

TBR=stuartmorgan@chromium.org

Review URL: https://codereview.chromium.org/473883002

Cr-Commit-Position: refs/heads/master@{#289510}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289510 0039d316-1c4b-4281-b951-d872f2087c98
parent 667568d3
......@@ -1618,7 +1618,7 @@
# not using the "current" SDK.
'ios_sdk%': '',
'ios_sdk_path%': '',
'ios_deployment_target%': '7.0',
'ios_deployment_target%': '6.0',
'conditions': [
# ios_product_name is set to the name of the .app bundle as it should
......@@ -5020,10 +5020,6 @@
'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
}]
],
}, {
# The default for deployment target of 7.0+ is libc++, so force
# the old behavior unless libc++ is enabled.
'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
}],
],
},
......
......@@ -6,8 +6,6 @@
#import <UIKit/UIKit.h>
#include <cmath>
#include "base/basictypes.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
......@@ -112,8 +110,7 @@ void PlatformFontIOS::CalculateMetrics() {
height_ = font.lineHeight;
ascent_ = font.ascender;
cap_height_ = font.capHeight;
NSDictionary* attributes = @{ NSFontAttributeName : font };
average_width_ = std::ceil([@"x" sizeWithAttributes:attributes].width);
average_width_ = [@"x" sizeWithFont:font].width;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -20,8 +20,7 @@ int GetStringWidth(const base::string16& text, const FontList& font_list) {
float GetStringWidthF(const base::string16& text, const FontList& font_list) {
NSString* ns_text = base::SysUTF16ToNSString(text);
NativeFont native_font = font_list.GetPrimaryFont().GetNativeFont();
NSDictionary* attributes = @{ NSFontAttributeName : native_font };
return std::ceil([ns_text sizeWithAttributes:attributes].width);
return [ns_text sizeWithFont:native_font].width;
}
} // namespace gfx
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment