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

Unified Diff: ui/gfx/render_text_pango.cc

Issue 382273002: ui/gfx: Allow for font-specific rendering settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix fontconfig leak Created 6 years, 5 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 | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/gfx/render_text_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_pango.cc
diff --git a/ui/gfx/render_text_pango.cc b/ui/gfx/render_text_pango.cc
index 94904366e60a8a14a8bf4483d90a030bfae45c9f..af0790a03d1834b9249b008f1c495963c35a88de 100644
--- a/ui/gfx/render_text_pango.cc
+++ b/ui/gfx/render_text_pango.cc
@@ -14,8 +14,10 @@
#include "third_party/skia/include/core/SkTypeface.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/font_list.h"
#include "ui/gfx/font_render_params.h"
#include "ui/gfx/pango_util.h"
+#include "ui/gfx/platform_font_pango.h"
#include "ui/gfx/utf16_indexing.h"
namespace gfx {
@@ -388,10 +390,9 @@ void RenderTextPango::DrawVisualText(Canvas* canvas) {
internal::SkiaTextRenderer renderer(canvas);
ApplyFadeEffects(&renderer);
ApplyTextShadows(&renderer);
-
- // TODO(derat): Use font-specific params: http://crbug.com/125235
- renderer.SetFontRenderParams(GetDefaultFontRenderParams(),
- background_is_transparent());
+ renderer.SetFontRenderParams(
+ font_list().GetPrimaryFont().GetFontRenderParams(),
+ background_is_transparent());
// Temporarily apply composition underlines and selection colors.
ApplyCompositionAndSelectionStyles();
@@ -406,7 +407,6 @@ void RenderTextPango::DrawVisualText(Canvas* canvas) {
ScopedPangoFontDescription desc(
pango_font_describe(run->item->analysis.font));
-
const std::string family_name =
pango_font_description_get_family(desc.get());
renderer.SetTextSize(GetPangoFontSizeInPixels(desc.get()));
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/gfx/render_text_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698