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

Unified Diff: ui/gfx/render_text.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.h ('k') | ui/gfx/render_text_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
===================================================================
--- ui/gfx/render_text.cc (revision 114424)
+++ ui/gfx/render_text.cc (working copy)
@@ -96,15 +96,23 @@
SkiaTextRenderer::~SkiaTextRenderer() {
}
+void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) {
+ paint_.setTypeface(typeface);
+}
+
+void SkiaTextRenderer::SetTextSize(int size) {
+ paint_.setTextSize(size);
+}
+
void SkiaTextRenderer::SetFont(const gfx::Font& font) {
SkAutoTUnref<SkTypeface> typeface(
SkTypeface::CreateFromName(font.GetFontName().c_str(),
SkTypeface::kNormal));
if (typeface.get()) {
// |paint_| adds its own ref. So don't |release()| it from the ref ptr here.
- paint_.setTypeface(typeface.get());
+ SetTypeface(typeface.get());
}
- paint_.setTextSize(font.GetFontSize());
+ SetTextSize(font.GetFontSize());
}
void SkiaTextRenderer::SetForegroundColor(SkColor foreground) {
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/gfx/render_text_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698