summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-12 00:52:10 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-12 00:52:10 +0000
commit2335026034ff63dba38e2293a446e89660d20bd4 (patch)
tree3858eeb378d999a5b8be3ad712f478401580996c /chrome/browser
parent07299d263ae6af4f9b8605ed71eccdbc3f3b1c62 (diff)
downloadchromium_src-2335026034ff63dba38e2293a446e89660d20bd4.zip
chromium_src-2335026034ff63dba38e2293a446e89660d20bd4.tar.gz
chromium_src-2335026034ff63dba38e2293a446e89660d20bd4.tar.bz2
GTK: Cache our GdkCursor objects, since building them hits the disk.
TEST=strace chrome. Moving the mouse over the webpage shouldn't spew open() calls. BUG=21623 Review URL: http://codereview.chromium.org/195071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc2
-rw-r--r--chrome/browser/gtk/gtk_chrome_link_button.cc3
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc3
3 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 15f4d9c..e0aa335 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1905,7 +1905,7 @@ gboolean BrowserWindowGtk::OnMouseMoveEvent(GtkWidget* widget,
browser->frame_cursor_ = NULL;
}
if (has_hit_edge) {
- browser->frame_cursor_ = gdk_cursor_new(new_cursor);
+ browser->frame_cursor_ = gtk_util::GetCursor(new_cursor);
gdk_window_set_cursor(GTK_WIDGET(browser->window_)->window,
browser->frame_cursor_);
} else {
diff --git a/chrome/browser/gtk/gtk_chrome_link_button.cc b/chrome/browser/gtk/gtk_chrome_link_button.cc
index fde471a..defb188 100644
--- a/chrome/browser/gtk/gtk_chrome_link_button.cc
+++ b/chrome/browser/gtk/gtk_chrome_link_button.cc
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include "base/logging.h"
+#include "chrome/common/gtk_util.h"
static const gchar* kLinkMarkup = "<u><span color=\"%s\">%s</span></u>";
@@ -182,7 +183,7 @@ static void gtk_chrome_link_button_init(GtkChromeLinkButton* button) {
button->is_blue = TRUE;
button->native_markup = NULL;
button->using_native_theme = TRUE;
- button->hand_cursor = gdk_cursor_new(GDK_HAND2);
+ button->hand_cursor = gtk_util::GetCursor(GDK_HAND2);
button->text = NULL;
gtk_container_add(GTK_CONTAINER(button), button->label);
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 0fb62b39..adc109f 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -24,6 +24,7 @@
#include "base/string_util.h"
#include "base/task.h"
#include "base/time.h"
+#include "chrome/common/gtk_util.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "chrome/common/x11_util.h"
#include "chrome/browser/renderer_host/backing_store.h"
@@ -607,7 +608,7 @@ void RenderWidgetHostViewGtk::ShowCurrentCursor() {
break;
default:
- gdk_cursor = gdk_cursor_new(current_cursor_.GetCursorType());
+ gdk_cursor = gtk_util::GetCursor(current_cursor_.GetCursorType());
}
gdk_window_set_cursor(view_.get()->window, gdk_cursor);
// The window now owns the cursor.