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

Unified Diff: chrome/browser/chromeos/frame/panel_controller.cc

Issue 9588003: browser: Minor changes to use SkPoint::iset() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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 | « no previous file | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/frame/panel_controller.cc
diff --git a/chrome/browser/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc
index 563b28a6be78ff3df20de48843c05a25f1e92773..79c27aef6605d0b709e4021355b6b8db27113406 100644
--- a/chrome/browser/chromeos/frame/panel_controller.cc
+++ b/chrome/browser/chromeos/frame/panel_controller.cc
@@ -74,8 +74,9 @@ class TitleBackgroundPainter : public views::Painter {
private:
// Overridden from views::Painter:
virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE {
- SkRect rect = { 0, 0, size.width(), size.height() };
SkPath path;
+ SkRect rect;
+ rect.iset(0, 0, size.width(), size.height());
SkScalar corners[] = {
kTitleCornerRadius, kTitleCornerRadius,
kTitleCornerRadius, kTitleCornerRadius,
@@ -83,17 +84,19 @@ class TitleBackgroundPainter : public views::Painter {
0, 0
};
path.addRoundRect(rect, corners);
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
- paint.setFlags(SkPaint::kAntiAlias_Flag);
- SkPoint p[2] = { {0, 0}, {0, size.height()} };
- SkColor colors[2] = {kTitleActiveGradientStart, kTitleActiveGradientEnd};
+ SkPoint points[2];
+ points[0].iset(0, 0);
+ points[1].iset(0, size.height());
+ SkColor colors[2] = { kTitleActiveGradientStart, kTitleActiveGradientEnd };
if (panel_controller_->urgent()) {
colors[0] = kTitleUrgentGradientStart;
colors[1] = kTitleUrgentGradientEnd;
}
SkShader* s = SkGradientShader::CreateLinear(
- p, colors, NULL, 2, SkShader::kClamp_TileMode, NULL);
+ points, colors, NULL, 2, SkShader::kClamp_TileMode, NULL);
+ SkPaint paint;
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setAntiAlias(true);
paint.setShader(s);
// Need to unref shader, otherwise never deleted.
s->unref();
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698