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

Unified Diff: chrome/browser/gtk/find_bar_gtk.cc

Issue 197046: Upload GdkPixbufs into cairo surfaces so they (hopefully) live on X (Closed)
Patch Set: Fix crash Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/find_bar_gtk.cc
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 503e1b8b1cb85f5132b7f343cbac91caf5a6fb4e..94301d29ff82dfcd798aeb6931b8f7135bc11f7e 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);

Powered by Google App Engine
This is Rietveld 408576698