Index: ui/gfx/canvas_mac.mm |
diff --git a/ui/gfx/canvas_mac.mm b/ui/gfx/canvas_mac.mm |
index a906873d4e50fa1f191c96491a2cdf0dcc80811a..fc91eb509576e0a8bf12cf6996a783c6fbb05763 100644 |
--- a/ui/gfx/canvas_mac.mm |
+++ b/ui/gfx/canvas_mac.mm |
@@ -9,7 +9,7 @@ |
#include "base/logging.h" |
#include "base/strings/sys_string_conversions.h" |
#include "third_party/skia/include/core/SkTypeface.h" |
-#include "ui/gfx/font.h" |
+#include "ui/gfx/font_list.h" |
#include "ui/gfx/rect.h" |
// Note: This is a temporary Skia-based implementation of the ui/gfx text |
@@ -36,7 +36,7 @@ namespace gfx { |
// static |
void Canvas::SizeStringInt(const base::string16& text, |
- const gfx::Font& font, |
+ const gfx::FontList& font_list, |
int* width, |
int* height, |
int line_height, |
@@ -44,18 +44,18 @@ void Canvas::SizeStringInt(const base::string16& text, |
DLOG_IF(WARNING, line_height != 0) << "Line heights not implemented."; |
DLOG_IF(WARNING, flags & Canvas::MULTI_LINE) << "Multi-line not implemented."; |
- NSFont* native_font = font.GetNativeFont(); |
+ NSFont* native_font = font_list.GetPrimaryFont().GetNativeFont(); |
NSString* ns_string = base::SysUTF16ToNSString(text); |
NSDictionary* attributes = |
[NSDictionary dictionaryWithObject:native_font |
forKey:NSFontAttributeName]; |
NSSize string_size = [ns_string sizeWithAttributes:attributes]; |
*width = string_size.width; |
- *height = font.GetHeight(); |
+ *height = font_list.GetHeight(); |
} |
void Canvas::DrawStringWithShadows(const base::string16& text, |
- const gfx::Font& font, |
+ const gfx::FontList& font_list, |
SkColor color, |
const gfx::Rect& text_bounds, |
int line_height, |
@@ -65,6 +65,7 @@ void Canvas::DrawStringWithShadows(const base::string16& text, |
DLOG_IF(WARNING, flags & Canvas::MULTI_LINE) << "Multi-line not implemented."; |
DLOG_IF(WARNING, !shadows.empty()) << "Text shadows not implemented."; |
+ const Font& font = font_list.GetPrimaryFont(); |
skia::RefPtr<SkTypeface> typeface = skia::AdoptRef( |
SkTypeface::CreateFromName( |
font.GetFontName().c_str(), FontTypefaceStyle(font))); |
@@ -79,10 +80,10 @@ void Canvas::DrawStringWithShadows(const base::string16& text, |
} |
void Canvas::DrawStringWithHalo(const base::string16& text, |
- const gfx::Font& font, |
+ const gfx::FontList& font_list, |
SkColor text_color, |
SkColor halo_color, |
- int x, int y, int w, int h, |
+ const gfx::Rect& display_rect, |
int flags) { |
} |