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

Unified Diff: ui/gfx/render_text_linux.cc

Issue 8910004: Optimize setting the font when drawing in RenderTextLinux. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 | « ui/gfx/render_text.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_linux.cc
===================================================================
--- ui/gfx/render_text_linux.cc (revision 114424)
+++ ui/gfx/render_text_linux.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/debug/trace_event.h"
#include "base/i18n/break_iterator.h"
#include "base/logging.h"
+#include "third_party/skia/include/core/SkTypeface.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/font.h"
#include "ui/gfx/pango_util.h"
@@ -319,7 +320,11 @@
pango_font_describe(run->item->analysis.font);
{
TRACE_EVENT0("gfx", "RenderTextLinux::DrawVisualText SetFont");
- renderer.SetFont(gfx::Font(native_font));
+ const char* family_name = pango_font_description_get_family(native_font);
+ SkAutoTUnref<SkTypeface> typeface(
+ SkTypeface::CreateFromName(family_name, SkTypeface::kNormal));
+ renderer.SetTypeface(typeface.get());
+ renderer.SetTextSize(GetPangoFontSizeInPixels(native_font));
}
pango_font_description_free(native_font);
« no previous file with comments | « ui/gfx/render_text.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698