| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 SkColor lighter = gradient_top_color ? GdkToSkColor(gradient_top_color) | 1065 SkColor lighter = gradient_top_color ? GdkToSkColor(gradient_top_color) |
| 1066 : color_utils::HSLShift(base, kGtkFrameShift); | 1066 : color_utils::HSLShift(base, kGtkFrameShift); |
| 1067 SkShader* shader = gfx::CreateGradientShader( | 1067 SkShader* shader = gfx::CreateGradientShader( |
| 1068 0, gradient_size, lighter, base); | 1068 0, gradient_size, lighter, base); |
| 1069 SkPaint paint; | 1069 SkPaint paint; |
| 1070 paint.setStyle(SkPaint::kFill_Style); | 1070 paint.setStyle(SkPaint::kFill_Style); |
| 1071 paint.setAntiAlias(true); | 1071 paint.setAntiAlias(true); |
| 1072 paint.setShader(shader); | 1072 paint.setShader(shader); |
| 1073 shader->unref(); | 1073 shader->unref(); |
| 1074 | 1074 |
| 1075 canvas.DrawRectInt(0, 0, kToolbarImageWidth, gradient_size, paint); | 1075 canvas.DrawRect(gfx::Rect(0, 0, kToolbarImageWidth, gradient_size), paint); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 canvas.FillRect(base, gfx::Rect(0, gradient_size, | 1078 canvas.FillRect(base, gfx::Rect(0, gradient_size, kToolbarImageWidth, |
| 1079 kToolbarImageWidth, | |
| 1080 kToolbarImageHeight - gradient_size)); | 1079 kToolbarImageHeight - gradient_size)); |
| 1081 return new SkBitmap(canvas.ExtractBitmap()); | 1080 return new SkBitmap(canvas.ExtractBitmap()); |
| 1082 } | 1081 } |
| 1083 | 1082 |
| 1084 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const { | 1083 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const { |
| 1085 SkBitmap* base_image = GetBitmapNamed(base_id); | 1084 SkBitmap* base_image = GetBitmapNamed(base_id); |
| 1086 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( | 1085 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( |
| 1087 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); | 1086 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); |
| 1088 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( | 1087 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( |
| 1089 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); | 1088 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 cairo_set_line_width(cr, 1.0); | 1237 cairo_set_line_width(cr, 1.0); |
| 1239 cairo_move_to(cr, start_x, widget->allocation.y); | 1238 cairo_move_to(cr, start_x, widget->allocation.y); |
| 1240 cairo_line_to(cr, start_x, | 1239 cairo_line_to(cr, start_x, |
| 1241 widget->allocation.y + widget->allocation.height); | 1240 widget->allocation.y + widget->allocation.height); |
| 1242 cairo_stroke(cr); | 1241 cairo_stroke(cr); |
| 1243 cairo_destroy(cr); | 1242 cairo_destroy(cr); |
| 1244 cairo_pattern_destroy(pattern); | 1243 cairo_pattern_destroy(pattern); |
| 1245 | 1244 |
| 1246 return TRUE; | 1245 return TRUE; |
| 1247 } | 1246 } |
| OLD | NEW |