diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 16:52:36 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 16:52:36 +0000 |
commit | de2baedbb8df526db72fb6ddc151e9435db8b78f (patch) | |
tree | b31900fe03fd0421907ae79f1216f5b55042363f /chrome/browser/autocomplete | |
parent | 6deb272a76b6214157cb9dec271e4c4e1a6d3e8f (diff) | |
download | chromium_src-de2baedbb8df526db72fb6ddc151e9435db8b78f.zip chromium_src-de2baedbb8df526db72fb6ddc151e9435db8b78f.tar.gz chromium_src-de2baedbb8df526db72fb6ddc151e9435db8b78f.tar.bz2 |
Have ResourceBundle own GdkPixbufs.
This is the same as how ResourceBundle owns the SkBitmaps it loads.
This should be faster than before because ResourceBundle will only
load each bitmap once and cache the image.
Also fix a memory leak in GdkPixbufFromSkBitmap.
valgrind says we're not leaking here.
BUG=9988
Review URL: http://codereview.chromium.org/67179
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rwxr-xr-x | chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index d87f996..1aebd30 100755 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -279,11 +279,11 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, // TODO(deanm): These would be better as pixmaps someday. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - static GdkPixbuf* o2_globe = rb.LoadPixbuf(IDR_O2_GLOBE); - static GdkPixbuf* o2_history = rb.LoadPixbuf(IDR_O2_HISTORY); - static GdkPixbuf* o2_more = rb.LoadPixbuf(IDR_O2_MORE); - static GdkPixbuf* o2_search = rb.LoadPixbuf(IDR_O2_SEARCH); - static GdkPixbuf* o2_star = rb.LoadPixbuf(IDR_O2_STAR); + static GdkPixbuf* o2_globe = rb.GetPixbufNamed(IDR_O2_GLOBE); + static GdkPixbuf* o2_history = rb.GetPixbufNamed(IDR_O2_HISTORY); + static GdkPixbuf* o2_more = rb.GetPixbufNamed(IDR_O2_MORE); + static GdkPixbuf* o2_search = rb.GetPixbufNamed(IDR_O2_SEARCH); + static GdkPixbuf* o2_star = rb.GetPixbufNamed(IDR_O2_STAR); GdkRectangle window_rect = GetWindowRect(event->window); // Handle when our window is super narrow. A bunch of the calculations |