Index: chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc |
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc |
index 0c5a187ff5cfb367d826e9a22b22097b412ed281..da9967017a2ca6e87534daeaa9d60c00db6a5dc9 100644 |
--- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc |
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc |
@@ -107,16 +107,6 @@ gfx::Rect GetRectForLine(size_t line, int width) { |
kHeightPerResult); |
} |
-// Helper for drawing an entire pixbuf without dithering. |
-void DrawFullImage(cairo_t* cr, GtkWidget* widget, const gfx::Image* image, |
- gint dest_x, gint dest_y) { |
- gfx::CairoCachedSurface* surface = image->ToCairo(); |
- surface->SetSource(cr, widget, dest_x, dest_y); |
- cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); |
- cairo_rectangle(cr, dest_x, dest_y, surface->Width(), surface->Height()); |
- cairo_fill(cr); |
-} |
- |
// TODO(deanm): Find some better home for this, and make it more efficient. |
size_t GetUTF8Offset(const string16& text, size_t text_offset) { |
return UTF16ToUTF8(text.substr(0, text_offset)).length(); |
@@ -662,9 +652,10 @@ gboolean OmniboxPopupViewGtk::HandleExpose(GtkWidget* widget, |
int icon_start_x = ltr ? kIconLeftPadding : |
(line_rect.width() - kIconLeftPadding - kIconWidth); |
// Draw the icon for this result. |
- DrawFullImage(cr, widget, |
- IconForMatch(*match, is_selected, is_selected_keyword), |
- icon_start_x, line_rect.y() + kIconTopPadding); |
+ gtk_util::DrawFullImage(cr, widget, |
+ IconForMatch(*match, is_selected, |
+ is_selected_keyword), |
+ icon_start_x, line_rect.y() + kIconTopPadding); |
// Draw the results text vertically centered in the results space. |
// First draw the contents / url, but don't let it take up the whole width |
@@ -738,10 +729,11 @@ gboolean OmniboxPopupViewGtk::HandleExpose(GtkWidget* widget, |
icon_start_x = ltr ? (line_rect.width() - kIconLeftPadding - kIconWidth) : |
kIconLeftPadding; |
// Draw the icon for this result. |
- DrawFullImage(cr, widget, |
- theme_service_->GetImageNamed( |
- is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS), |
- icon_start_x, line_rect.y() + kIconTopPadding); |
+ gtk_util::DrawFullImage(cr, widget, |
+ theme_service_->GetImageNamed( |
+ is_selected ? IDR_OMNIBOX_TTS_DARK : |
+ IDR_OMNIBOX_TTS), |
+ icon_start_x, line_rect.y() + kIconTopPadding); |
} |
} |