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

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: Some of estade's nits 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
« no previous file with comments | « chrome/browser/ui/gtk/gtk_theme_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9237d24f124ff4b07aee33d1d0fe5b5e30067eda 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
@@ -846,35 +846,27 @@ void TabRendererGtk::PaintTitle(GtkWidget* widget, cairo_t* cr) {
void TabRendererGtk::PaintIcon(GtkWidget* widget, cairo_t* cr) {
if (loading_animation_.animation_state() != ANIMATION_NONE) {
PaintLoadingAnimation(widget, cr);
- } else {
- 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);
- } else {
- 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);
- } 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);
- }
- }
+ return;
+ }
+
+ CairoCachedSurface* to_display = NULL;
+ if (should_display_crashed_favicon_) {
+ to_display = theme_service_->GetSurfaceNamed(IDR_SAD_FAVICON, widget);
+ } else if (!data_.favicon.isNull()) {
+ if (data_.is_default_favicon && theme_service_->UsingNativeTheme()) {
+ to_display = theme_service_->GetCairoIcon(
+ GtkThemeService::NATIVE_FAVICON, widget);
+ } else if (data_.cairo_favicon.valid()) {
+ to_display = &data_.cairo_favicon;
}
}
+
+ if (to_display) {
+ to_display->SetSource(cr,
+ favicon_bounds_.x(),
+ favicon_bounds_.y() + favicon_hiding_offset_);
+ cairo_paint(cr);
+ }
}
void TabRendererGtk::PaintTabBackground(GtkWidget* widget, cairo_t* cr) {
« no previous file with comments | « 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