diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 15:38:31 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 15:38:31 +0000 |
commit | 8b3963bcb3a05214909e2330982b418c77c380f6 (patch) | |
tree | e362a025998802d8a57f4cf63cc5499d6745cf08 | |
parent | 7ce675e934626d730f7a5c488d771ac91a61732f (diff) | |
download | chromium_src-8b3963bcb3a05214909e2330982b418c77c380f6.zip chromium_src-8b3963bcb3a05214909e2330982b418c77c380f6.tar.gz chromium_src-8b3963bcb3a05214909e2330982b418c77c380f6.tar.bz2 |
Massively improve the performance of dragging a window over our window.
Our toolbar background is a 1 pixel wide image, which we tile by drawing a
pixbuf over and over. The way the toolbar is laid out, everything shares
the same window. The toolbar is painted first, then the buttons on top of
it, etc. If the toolbar painting is slow, you can see gray trails when you
drag a window over and the exposes are slow to come back to X.
Honor the damage rect, so when we get tons of tiny exposes we aren't doing
this really inefficient tiling over the entire toolbar. Improving the tiling
performance needs to be done separately.
Review URL: http://codereview.chromium.org/100036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14604 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/browser_toolbar_gtk.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index e87f32c..64bae89 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -310,8 +310,10 @@ void BrowserToolbarGtk::BuildToolbarMenuButton( gboolean BrowserToolbarGtk::OnContentAreaExpose(GtkWidget* widget, GdkEventExpose* e, BrowserToolbarGtk* toolbar) { + // TODO(deanm): We should improve the tiling performance, or not use NineBox. + // For now at least honor the damage rect to avoid unnecessary painting. toolbar->background_ninebox_.get()->RenderTopCenterStrip(widget, - 0, widget->allocation.width, -2); + e->area.x, e->area.x + e->area.width, -2); return FALSE; // Allow subwidgets to paint. } |