Chromium Code Reviews| 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 "ui/views/background.h" | 5 #include "ui/views/background.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "skia/ext/skia_utils_win.h" | 8 #include "skia/ext/skia_utils_win.h" |
| 9 #include "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 SkColor color2) { | 107 SkColor color2) { |
| 108 Background* background = CreateBackgroundPainter( | 108 Background* background = CreateBackgroundPainter( |
| 109 true, Painter::CreateVerticalGradient(color1, color2)); | 109 true, Painter::CreateVerticalGradient(color1, color2)); |
| 110 background->SetNativeControlColor( | 110 background->SetNativeControlColor( |
| 111 color_utils::AlphaBlend(color1, color2, 128)); | 111 color_utils::AlphaBlend(color1, color2, 128)); |
| 112 | 112 |
| 113 return background; | 113 return background; |
| 114 } | 114 } |
| 115 | 115 |
| 116 //static | 116 //static |
| 117 Background* Background::CreateVerticalGradientRangeBackground( | |
| 118 SkColor color1, SkColor color2, float start, float end) { | |
|
msw
2012/08/08 17:12:20
nit: one param per line
markusheintz_
2012/08/08 21:53:55
Done.
| |
| 119 Background* background = CreateBackgroundPainter( | |
| 120 true, Painter::CreateVerticalGradientRange(color1, color2, start, end)); | |
| 121 background->SetNativeControlColor( | |
| 122 color_utils::AlphaBlend(color1, color2, 128)); | |
| 123 | |
| 124 return background; | |
| 125 } | |
| 126 | |
| 127 //static | |
| 117 Background* Background::CreateBackgroundPainter(bool owns_painter, | 128 Background* Background::CreateBackgroundPainter(bool owns_painter, |
| 118 Painter* painter) { | 129 Painter* painter) { |
| 119 return new BackgroundPainter(owns_painter, painter); | 130 return new BackgroundPainter(owns_painter, painter); |
| 120 } | 131 } |
| 121 | 132 |
| 122 } // namespace views | 133 } // namespace views |
| OLD | NEW |