OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 0, gradient_size, lighter, base); | 1010 0, gradient_size, lighter, base); |
1011 SkPaint paint; | 1011 SkPaint paint; |
1012 paint.setStyle(SkPaint::kFill_Style); | 1012 paint.setStyle(SkPaint::kFill_Style); |
1013 paint.setAntiAlias(true); | 1013 paint.setAntiAlias(true); |
1014 paint.setShader(shader); | 1014 paint.setShader(shader); |
1015 shader->unref(); | 1015 shader->unref(); |
1016 | 1016 |
1017 canvas.DrawRect(gfx::Rect(0, 0, kToolbarImageWidth, gradient_size), paint); | 1017 canvas.DrawRect(gfx::Rect(0, 0, kToolbarImageWidth, gradient_size), paint); |
1018 } | 1018 } |
1019 | 1019 |
1020 canvas.FillRect(base, gfx::Rect(0, gradient_size, | 1020 canvas.FillRect(gfx::Rect(0, gradient_size, kToolbarImageWidth, |
1021 kToolbarImageWidth, | 1021 kToolbarImageHeight - gradient_size), base); |
1022 kToolbarImageHeight - gradient_size)); | |
1023 return new SkBitmap(canvas.ExtractBitmap()); | 1022 return new SkBitmap(canvas.ExtractBitmap()); |
1024 } | 1023 } |
1025 | 1024 |
1026 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const { | 1025 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const { |
1027 SkBitmap* base_image = GetBitmapNamed(base_id); | 1026 SkBitmap* base_image = GetBitmapNamed(base_id); |
1028 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( | 1027 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( |
1029 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); | 1028 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); |
1030 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( | 1029 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( |
1031 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); | 1030 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); |
1032 } | 1031 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 cairo_new_path(cr); | 1130 cairo_new_path(cr); |
1132 cairo_set_line_width(cr, 1.0); | 1131 cairo_set_line_width(cr, 1.0); |
1133 cairo_move_to(cr, start_x, allocation.y); | 1132 cairo_move_to(cr, start_x, allocation.y); |
1134 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1133 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
1135 cairo_stroke(cr); | 1134 cairo_stroke(cr); |
1136 cairo_destroy(cr); | 1135 cairo_destroy(cr); |
1137 cairo_pattern_destroy(pattern); | 1136 cairo_pattern_destroy(pattern); |
1138 | 1137 |
1139 return TRUE; | 1138 return TRUE; |
1140 } | 1139 } |
OLD | NEW |