summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 17:19:29 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 17:19:29 +0000
commitf5c655de4121427b4d9d9dc218efd29afa8bba8c (patch)
treed731b3ec3b974c96d21c54610b529c474a0fd7b2 /views/controls
parent2e360844a496013fc57c527fd5d6c4da165b09f7 (diff)
downloadchromium_src-f5c655de4121427b4d9d9dc218efd29afa8bba8c.zip
chromium_src-f5c655de4121427b4d9d9dc218efd29afa8bba8c.tar.gz
chromium_src-f5c655de4121427b4d9d9dc218efd29afa8bba8c.tar.bz2
Attempt 2 at converting font from Skia to Pango. The slow down appears to be entirely attributed to asking for the metrics. To get back the performance I did the following:
. Only ask for the metrics when needed. We appear to create 6 or so fonts very early on without needing the metrics. This ensures we only take the metrics load hit when needed. . Keep a cache of the metrics around. This ensures that we only load the metrics once. I didn't dig through the Pango source to see why Pango is slow at getting metrics. I suspect it's the first person to ask for metrics incurs a penalty as Pango accesses the disk. The code we have now is the same as that as Gtk. Review URL: http://codereview.chromium.org/199101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/button/native_button_gtk.cc5
-rw-r--r--views/controls/textfield/native_textfield_gtk.cc3
2 files changed, 2 insertions, 6 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc
index c5f0f1a..fd89da2 100644
--- a/views/controls/button/native_button_gtk.cc
+++ b/views/controls/button/native_button_gtk.cc
@@ -41,11 +41,8 @@ void NativeButtonGtk::UpdateFont() {
if (!native_view())
return;
- NOTIMPLEMENTED();
preferred_size_ = gfx::Size();
- // SendMessage(GetHWND(), WM_SETFONT,
- // reinterpret_cast<WPARAM>(native_button_->font().hfont()),
- // FALSE);
+ gtk_widget_modify_font(native_view(), native_button_->font().nativeFont());
}
void NativeButtonGtk::UpdateEnabled() {
diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc
index ef7a67d..34c4a1f 100644
--- a/views/controls/textfield/native_textfield_gtk.cc
+++ b/views/controls/textfield/native_textfield_gtk.cc
@@ -105,8 +105,7 @@ void NativeTextfieldGtk::UpdateReadOnly() {
void NativeTextfieldGtk::UpdateFont() {
if (!native_view())
return;
- gtk_widget_modify_font(native_view(),
- gfx::Font::PangoFontFromGfxFont(textfield_->font()));
+ gtk_widget_modify_font(native_view(), textfield_->font().nativeFont());
}
void NativeTextfieldGtk::UpdateEnabled() {