Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Issue 197046: Upload GdkPixbufs into cairo surfaces so they (hopefully) live on X (Closed)

Created:
11 years, 3 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
Reviewers:
tony, agl, Evan Martin
CC:
chromium-reviews_googlegroups.com, Dean McNamee
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=25814

Patch Set 1 #

Patch Set 2 : Redo with the GtkThemeProvider owning most CairoCachedSurfaces #

Patch Set 3 : valgrind clean. #

Patch Set 4 : Fix crash #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -117 lines) Patch
M chrome/browser/browser_theme_provider.h View 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/gtk/bookmark_bar_gtk.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/gtk/browser_toolbar_gtk.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/gtk/browser_window_gtk.cc View 10 chunks +42 lines, -45 lines 0 comments Download
A chrome/browser/gtk/cairo_cached_surface.h View 1 2 1 chunk +55 lines, -0 lines 3 comments Download
A chrome/browser/gtk/cairo_cached_surface.cc View 1 1 chunk +72 lines, -0 lines 0 comments Download
M chrome/browser/gtk/custom_button.h View 3 chunks +7 lines, -4 lines 2 comments Download
M chrome/browser/gtk/custom_button.cc View 1 2 7 chunks +50 lines, -39 lines 0 comments Download
M chrome/browser/gtk/find_bar_gtk.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/gtk/go_button_gtk.cc View 2 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.h View 2 3 5 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.cc View 2 3 3 chunks +33 lines, -0 lines 0 comments Download
M chrome/browser/gtk/toolbar_star_toggle_gtk.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M chrome/chrome.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Elliot Glaysher
[agl for pre-review where I walk over to his desk and show him this]
11 years, 3 months ago (2009-09-08 21:42:32 UTC) #1
Elliot Glaysher
Sending out for real review now.
11 years, 3 months ago (2009-09-09 20:59:02 UTC) #2
agl
I don't really know this UI code, but LGTM.
11 years, 3 months ago (2009-09-09 21:07:01 UTC) #3
tony
LGTM2. cc-ing dean since he might be curious. http://codereview.chromium.org/197046/diff/7001/5007 File chrome/browser/gtk/cairo_cached_surface.h (right): http://codereview.chromium.org/197046/diff/7001/5007#newcode26 Line 26: ...
11 years, 3 months ago (2009-09-09 21:26:21 UTC) #4
Evan Martin
Since this is more code and complexity, can you measure the performance difference? Otherwise, why ...
11 years, 3 months ago (2009-09-09 21:28:08 UTC) #5
Elliot Glaysher
It's amazingly measurable. Average time to run BrowserWindowGtk::CustomFrameExpose with the old code: 20.5ms. Average time ...
11 years, 3 months ago (2009-09-09 21:45:53 UTC) #6
Evan Martin
11 years, 3 months ago (2009-09-09 21:50:34 UTC) #7
LGTM

may wanna check with xrestop that your x server memory usage doesn't go through
the roof (or leak in general)

http://codereview.chromium.org/197046/diff/7001/5007
File chrome/browser/gtk/cairo_cached_surface.h (right):

http://codereview.chromium.org/197046/diff/7001/5007#newcode34
Line 34: // the X Server occurs at SetSource() time. Calling UsePixbuf() should
only
I think "server" should be lowercase, here and below.

http://codereview.chromium.org/197046/diff/7001/5009
File chrome/browser/gtk/custom_button.h (right):

http://codereview.chromium.org/197046/diff/7001/5009#newcode41
Line 41: int width();
const?
maybe should be uppercase because it's not a simple getter

Powered by Google App Engine
This is Rietveld 408576698