summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/find_bar_gtk.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 23:07:10 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 23:07:10 +0000
commit40bad03889d4fc90799fdfe39a3fd503cdfb492e (patch)
tree97aaad871aabb0c5d6610a2f6b5cd090cab2ecf2 /chrome/browser/gtk/find_bar_gtk.cc
parentcdbb8e420ace50fb0fe7bf57f82f000b45ed09cd (diff)
downloadchromium_src-40bad03889d4fc90799fdfe39a3fd503cdfb492e.zip
chromium_src-40bad03889d4fc90799fdfe39a3fd503cdfb492e.tar.gz
chromium_src-40bad03889d4fc90799fdfe39a3fd503cdfb492e.tar.bz2
Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the X server and have better performance. In the presence of XRender, let cairo do things smarter.
This is a big win performance wise. BrowserWindowGtk::OnCustomFrameExpose, a heavy user of images sped up from an average runtime of 20.5ms to 0.7ms. TEST=Run through valgrind, don't leak memory. TEST=Run both before and after using xtrace. Notice fewer XCreatePixmap requests and more XRender-CreatePicture requests. BUG=http://crbug.com/10499 Review URL: http://codereview.chromium.org/197046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25814 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/find_bar_gtk.cc')
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 503e1b8..94301d2 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/gtk/browser_window_gtk.h"
+#include "chrome/browser/gtk/cairo_cached_surface.h"
#include "chrome/browser/gtk/custom_button.h"
#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/gtk/nine_box.h"
@@ -762,14 +763,13 @@ gboolean FindBarGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
cairo_clip(cr);
gfx::Point tabstrip_origin =
bar->window_->tabstrip()->GetTabStripOriginForWidget(widget);
- GdkPixbuf* background = bar->browser_->profile()->GetThemeProvider()->
- GetPixbufNamed(IDR_THEME_TOOLBAR);
- gdk_cairo_set_source_pixbuf(cr, background,
- tabstrip_origin.x(), tabstrip_origin.y());
+ CairoCachedSurface* background = bar->theme_provider_->GetSurfaceNamed(
+ IDR_THEME_TOOLBAR, widget);
+ background->SetSource(cr, tabstrip_origin.x(), tabstrip_origin.y());
cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
cairo_rectangle(cr, tabstrip_origin.x(), tabstrip_origin.y(),
e->area.x + e->area.width - tabstrip_origin.x(),
- gdk_pixbuf_get_height(background));
+ background->Height());
cairo_fill(cr);
cairo_destroy(cr);