OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 5 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( | 1073 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( |
1074 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); | 1074 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); |
1075 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( | 1075 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( |
1076 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); | 1076 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); |
1077 } | 1077 } |
1078 | 1078 |
1079 SkBitmap* GtkThemeService::GenerateTintedIcon( | 1079 SkBitmap* GtkThemeService::GenerateTintedIcon( |
1080 int base_id, | 1080 int base_id, |
1081 const color_utils::HSL& tint) const { | 1081 const color_utils::HSL& tint) const { |
1082 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1082 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
1083 scoped_ptr<SkBitmap> button(new SkBitmap(*rb.GetBitmapNamed(base_id))); | |
1084 return new SkBitmap(SkBitmapOperations::CreateHSLShiftedBitmap( | 1083 return new SkBitmap(SkBitmapOperations::CreateHSLShiftedBitmap( |
1085 *button, tint)); | 1084 *rb.GetBitmapNamed(base_id), tint)); |
1086 } | 1085 } |
1087 | 1086 |
1088 void GtkThemeService::GetNormalButtonTintHSL( | 1087 void GtkThemeService::GetNormalButtonTintHSL( |
1089 color_utils::HSL* tint) const { | 1088 color_utils::HSL* tint) const { |
1090 GtkStyle* window_style = gtk_rc_get_style(fake_window_); | 1089 GtkStyle* window_style = gtk_rc_get_style(fake_window_); |
1091 const GdkColor accent_gdk_color = window_style->bg[GTK_STATE_SELECTED]; | 1090 const GdkColor accent_gdk_color = window_style->bg[GTK_STATE_SELECTED]; |
1092 const GdkColor base_color = window_style->base[GTK_STATE_NORMAL]; | 1091 const GdkColor base_color = window_style->base[GTK_STATE_NORMAL]; |
1093 | 1092 |
1094 GtkStyle* label_style = gtk_rc_get_style(fake_label_.get()); | 1093 GtkStyle* label_style = gtk_rc_get_style(fake_label_.get()); |
1095 const GdkColor text_color = label_style->fg[GTK_STATE_NORMAL]; | 1094 const GdkColor text_color = label_style->fg[GTK_STATE_NORMAL]; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 cairo_set_line_width(cr, 1.0); | 1195 cairo_set_line_width(cr, 1.0); |
1197 cairo_move_to(cr, start_x, widget->allocation.y); | 1196 cairo_move_to(cr, start_x, widget->allocation.y); |
1198 cairo_line_to(cr, start_x, | 1197 cairo_line_to(cr, start_x, |
1199 widget->allocation.y + widget->allocation.height); | 1198 widget->allocation.y + widget->allocation.height); |
1200 cairo_stroke(cr); | 1199 cairo_stroke(cr); |
1201 cairo_destroy(cr); | 1200 cairo_destroy(cr); |
1202 cairo_pattern_destroy(pattern); | 1201 cairo_pattern_destroy(pattern); |
1203 | 1202 |
1204 return TRUE; | 1203 return TRUE; |
1205 } | 1204 } |
OLD | NEW |