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

Unified Diff: gfx/canvas_skia_linux.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/common/extensions/extension_action.cc ('k') | gfx/canvas_skia_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas_skia_linux.cc
===================================================================
--- gfx/canvas_skia_linux.cc (revision 55911)
+++ gfx/canvas_skia_linux.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "gfx/font.h"
#include "gfx/gtk_util.h"
+#include "gfx/platform_font_gtk.h"
#include "gfx/rect.h"
namespace {
@@ -149,7 +150,7 @@
resolution);
}
- PangoFontDescription* desc = gfx::Font::PangoFontFromGfxFont(font);
+ PangoFontDescription* desc = font.GetNativeFont();
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
@@ -246,10 +247,12 @@
cairo_move_to(cr, x, y);
pango_cairo_show_layout(cr, layout);
- if (font.style() & gfx::Font::UNDERLINED) {
+ if (font.GetStyle() & gfx::Font::UNDERLINED) {
+ gfx::PlatformFontGtk* platform_font =
+ static_cast<gfx::PlatformFontGtk*>(font.platform_font());
double underline_y =
- static_cast<double>(y) + height + font.underline_position();
- cairo_set_line_width(cr, font.underline_thickness());
+ static_cast<double>(y) + height + platform_font->underline_position();
+ cairo_set_line_width(cr, platform_font->underline_thickness());
cairo_move_to(cr, x, underline_y);
cairo_line_to(cr, x + width, underline_y);
cairo_stroke(cr);
« no previous file with comments | « chrome/common/extensions/extension_action.cc ('k') | gfx/canvas_skia_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698