summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/custom_button.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 18:16:15 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 18:16:15 +0000
commiteafb5b7bf242e8ebd9c947012ca404dd904bc1bd (patch)
tree697b1e9468e78b390233af5e8c696ff14f65fa72 /chrome/browser/gtk/custom_button.h
parente28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c (diff)
downloadchromium_src-eafb5b7bf242e8ebd9c947012ca404dd904bc1bd.zip
chromium_src-eafb5b7bf242e8ebd9c947012ca404dd904bc1bd.tar.gz
chromium_src-eafb5b7bf242e8ebd9c947012ca404dd904bc1bd.tar.bz2
Reapplies the GdkPixbuf -> cairo surface patch.
Only difference is explicitly calling a FreePerDisplaySurfaces() function from ~GtkThemeProvider() because vtables are set to base class during destructor calling. BUG=http://crbug.com/10499 Original Review URL: http://codereview.chromium.org/197046 Review URL: http://codereview.chromium.org/199077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/custom_button.h')
-rw-r--r--chrome/browser/gtk/custom_button.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/gtk/custom_button.h b/chrome/browser/gtk/custom_button.h
index 768b4ca..27dc275 100644
--- a/chrome/browser/gtk/custom_button.h
+++ b/chrome/browser/gtk/custom_button.h
@@ -16,6 +16,7 @@
#include "chrome/common/owned_widget_gtk.h"
#include "third_party/skia/include/core/SkBitmap.h"
+class CairoCachedSurface;
class GtkThemeProvider;
// These classes implement two kinds of custom-drawn buttons. They're
@@ -36,7 +37,9 @@ class CustomDrawButtonBase : public NotificationObserver {
~CustomDrawButtonBase();
- GdkPixbuf* pixbufs(int i) const { return pixbufs_[i]; }
+ // Returns the dimensions of the first surface.
+ int Width() const;
+ int Height() const;
gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e);
@@ -52,12 +55,12 @@ class CustomDrawButtonBase : public NotificationObserver {
const NotificationDetails& details);
private:
- // We store one GdkPixbuf* for each possible state of the button;
+ // We store one surface for each possible state of the button;
// INSENSITIVE is the last available state;
- GdkPixbuf* pixbufs_[GTK_STATE_INSENSITIVE + 1];
+ scoped_ptr<CairoCachedSurface> surfaces_[GTK_STATE_INSENSITIVE + 1];
// The background image.
- GdkPixbuf* background_image_;
+ scoped_ptr<CairoCachedSurface> background_image_;
// If non-negative, the state to paint the button.
int paint_override_;