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

Side by Side Diff: chrome/browser/ui/gtk/gtk_theme_service.cc

Issue 8476019: ui/gfx: Convert Canvas::DrawRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 SkColor lighter = gradient_top_color ? GdkToSkColor(gradient_top_color) 1067 SkColor lighter = gradient_top_color ? GdkToSkColor(gradient_top_color)
1068 : color_utils::HSLShift(base, kGtkFrameShift); 1068 : color_utils::HSLShift(base, kGtkFrameShift);
1069 SkShader* shader = gfx::CreateGradientShader( 1069 SkShader* shader = gfx::CreateGradientShader(
1070 0, gradient_size, lighter, base); 1070 0, gradient_size, lighter, base);
1071 SkPaint paint; 1071 SkPaint paint;
1072 paint.setStyle(SkPaint::kFill_Style); 1072 paint.setStyle(SkPaint::kFill_Style);
1073 paint.setAntiAlias(true); 1073 paint.setAntiAlias(true);
1074 paint.setShader(shader); 1074 paint.setShader(shader);
1075 shader->unref(); 1075 shader->unref();
1076 1076
1077 canvas.DrawRectInt(0, 0, kToolbarImageWidth, gradient_size, paint); 1077 canvas.DrawRect(gfx::Rect(0, 0, kToolbarImageWidth, gradient_size), paint);
1078 } 1078 }
1079 1079
1080 canvas.FillRect(base, gfx::Rect(0, gradient_size, 1080 canvas.FillRect(base, gfx::Rect(0, gradient_size, kToolbarImageWidth,
1081 kToolbarImageWidth,
1082 kToolbarImageHeight - gradient_size)); 1081 kToolbarImageHeight - gradient_size));
1083 return new SkBitmap(canvas.ExtractBitmap()); 1082 return new SkBitmap(canvas.ExtractBitmap());
1084 } 1083 }
1085 1084
1086 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const { 1085 SkBitmap* GtkThemeService::GenerateTabImage(int base_id) const {
1087 SkBitmap* base_image = GetBitmapNamed(base_id); 1086 SkBitmap* base_image = GetBitmapNamed(base_id);
1088 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap( 1087 SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap(
1089 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB)); 1088 *base_image, GetTint(ThemeService::TINT_BACKGROUND_TAB));
1090 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap( 1089 return new SkBitmap(SkBitmapOperations::CreateTiledBitmap(
1091 bg_tint, 0, 0, bg_tint.width(), bg_tint.height())); 1090 bg_tint, 0, 0, bg_tint.width(), bg_tint.height()));
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 cairo_set_line_width(cr, 1.0); 1239 cairo_set_line_width(cr, 1.0);
1241 cairo_move_to(cr, start_x, widget->allocation.y); 1240 cairo_move_to(cr, start_x, widget->allocation.y);
1242 cairo_line_to(cr, start_x, 1241 cairo_line_to(cr, start_x,
1243 widget->allocation.y + widget->allocation.height); 1242 widget->allocation.y + widget->allocation.height);
1244 cairo_stroke(cr); 1243 cairo_stroke(cr);
1245 cairo_destroy(cr); 1244 cairo_destroy(cr);
1246 cairo_pattern_destroy(pattern); 1245 cairo_pattern_destroy(pattern);
1247 1246
1248 return TRUE; 1247 return TRUE;
1249 } 1248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698