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

Unified Diff: chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc

Issue 8341089: GTK: More profiling of the rendering path. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 2 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/ui/gtk/tabs/tab_renderer_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
index cbc9a213e31aa0cd2abc4dabda00560a505c8c92..eb3ab9823a5e37228825f6eed1e3858874360a38 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
@@ -847,33 +847,26 @@ void TabRendererGtk::PaintIcon(GtkWidget* widget, cairo_t* cr) {
if (loading_animation_.animation_state() != ANIMATION_NONE) {
PaintLoadingAnimation(widget, cr);
Evan Stade 2011/10/28 20:34:25 return; instead of having rest of function in else
Elliot Glaysher 2011/10/28 20:48:42 Done.
} else {
+ CairoCachedSurface* to_display = NULL;
Evan Stade 2011/10/28 20:34:25 for your consideration: CairoCachedSurface* to_di
if (should_display_crashed_favicon_) {
- theme_service_->GetSurfaceNamed(IDR_SAD_FAVICON, widget)->SetSource(
- cr, favicon_bounds_.x(),
- favicon_bounds_.y() + favicon_hiding_offset_);
- cairo_paint(cr);
+ to_display = theme_service_->GetSurfaceNamed(IDR_SAD_FAVICON, widget);
} else {
Evan Stade 2011/10/28 20:34:25 this can be else if instead of else { if
Elliot Glaysher 2011/10/28 20:48:42 Done.
if (!data_.favicon.isNull()) {
if (data_.is_default_favicon && theme_service_->UsingNativeTheme()) {
- GdkPixbuf* favicon = GtkThemeService::GetDefaultFavicon(true);
-
- // TODO(erg): Get GtkThemeService to hand us a
- // CairoCachedSurface. Then we can simplify all of this.
- gdk_cairo_set_source_pixbuf(
- cr, favicon, favicon_bounds_.x(),
- favicon_bounds_.y() + favicon_hiding_offset_);
- cairo_paint(cr);
+ to_display = theme_service_->GetCairoIcon(
+ GtkThemeService::NATIVE_FAVICON, widget);
} else if (data_.cairo_favicon.valid()) {
- // TODO(erg): We should research whether we still need to draw app
- // icons larger. We don't appear to be getting larger icons.
- data_.cairo_favicon.SetSource(
- cr,
- favicon_bounds_.x(),
- favicon_bounds_.y() + favicon_hiding_offset_);
- cairo_paint(cr);
+ to_display = &data_.cairo_favicon;
}
}
}
+
+ if (to_display) {
+ to_display->SetSource(cr,
+ favicon_bounds_.x(),
+ favicon_bounds_.y() + favicon_hiding_offset_);
+ cairo_paint(cr);
+ }
}
}
« chrome/browser/ui/gtk/gtk_theme_service.h ('K') | « chrome/browser/ui/gtk/gtk_theme_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698