diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-26 23:33:05 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-26 23:33:05 +0000 |
commit | dc64a63b39f2a047dd597068182c01a2943c396b (patch) | |
tree | 400f92c0e44ef36d358d00d28b7ae5937902a747 /chrome/browser/gtk/custom_button.cc | |
parent | e9754eb9c5971d176ab436a1ee6d9f6fc504c17f (diff) | |
download | chromium_src-dc64a63b39f2a047dd597068182c01a2943c396b.zip chromium_src-dc64a63b39f2a047dd597068182c01a2943c396b.tar.gz chromium_src-dc64a63b39f2a047dd597068182c01a2943c396b.tar.bz2 |
Change NineBox to render into a GtkWidget. This offers a minor speedup and simplification of code because we get rid of the pixbuf middleman.
Review URL: http://codereview.chromium.org/42620
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/custom_button.cc')
-rw-r--r-- | chrome/browser/gtk/custom_button.cc | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc index 7fdd4cf..5609937 100644 --- a/chrome/browser/gtk/custom_button.cc +++ b/chrome/browser/gtk/custom_button.cc @@ -111,24 +111,8 @@ gboolean CustomContainerButton::OnExpose(GtkWidget* widget, GdkEventExpose* e, nine_box = button->nine_box_active_.get(); // Only draw theme graphics if we have some. - if (nine_box) { - GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, - true, // alpha - 8, // bits per channel - widget->allocation.width, - widget->allocation.height); - - nine_box->RenderToPixbuf(pixbuf); - - gdk_draw_pixbuf(widget->window, - widget->style->fg_gc[GTK_WIDGET_STATE(widget)], - pixbuf, - 0, 0, - widget->allocation.x, widget->allocation.y, -1, -1, - GDK_RGB_DITHER_NONE, 0, 0); - - gdk_pixbuf_unref(pixbuf); - } + if (nine_box) + nine_box->RenderToWidget(widget); // If we return FALSE from the function, the button paints itself. // If we return TRUE, no children are painted. |