diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-13 16:43:03 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-13 16:43:03 +0000 |
commit | c6ac841f51c0b884b38e917ac30b1dfde0dc43a7 (patch) | |
tree | 2b490ffa6795f72e7232d658b766785f0de64e38 /gfx/canvas_skia_mac.mm | |
parent | 6b32b95cff99ee72fd7824237ae5070263e5c496 (diff) | |
download | chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.zip chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.tar.gz chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.tar.bz2 |
Rework gfx::Font by moving platform-specific code into inner classes.
gfx::Font is a platform-neutral API shim that exists as a wrapper object to allow for the creation and lifetime of gfx::Font objects to remain consistent with past usage.
gfx::PlatformFont is an interface implemented by the platform-specific inner classes (gfx::PlatformFontWin,Mac,Gtk).
BUG=none
TEST=existing unittests
Review URL: http://codereview.chromium.org/3083022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/canvas_skia_mac.mm')
-rw-r--r-- | gfx/canvas_skia_mac.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/canvas_skia_mac.mm b/gfx/canvas_skia_mac.mm index 7836869..e2cb553 100644 --- a/gfx/canvas_skia_mac.mm +++ b/gfx/canvas_skia_mac.mm @@ -28,14 +28,14 @@ CanvasSkia::~CanvasSkia() { void CanvasSkia::SizeStringInt(const std::wstring& text, const gfx::Font& font, int *width, int *height, int flags) { - NSFont* native_font = font.nativeFont(); + NSFont* native_font = font.GetNativeFont(); NSString* ns_string = base::SysWideToNSString(text); NSDictionary* attributes = [NSDictionary dictionaryWithObject:native_font forKey:NSFontAttributeName]; NSSize string_size = [ns_string sizeWithAttributes:attributes]; *width = string_size.width; - *height = font.height(); + *height = font.GetHeight(); } void CanvasSkia::DrawStringInt(const std::wstring& text, const gfx::Font& font, @@ -59,7 +59,7 @@ void CanvasSkia::DrawStringInt(const std::wstring& text, const gfx::Font& font, NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys: - font.nativeFont(), NSFontAttributeName, + font.GetNativeFont(), NSFontAttributeName, ns_color, NSForegroundColorAttributeName, ns_style, NSParagraphStyleAttributeName, nil]; |