| 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/controls/progress_bar.h" | 5 #include "ui/views/controls/progress_bar.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // Draw inner if wide enough. | 221 // Draw inner if wide enough. |
| 222 if (progress_width > kBorderWidth * 2) { | 222 if (progress_width > kBorderWidth * 2) { |
| 223 canvas->Save(); | 223 canvas->Save(); |
| 224 | 224 |
| 225 SkPath inner_path; | 225 SkPath inner_path; |
| 226 AddRoundRectPathWithPadding( | 226 AddRoundRectPathWithPadding( |
| 227 bar_left, bar_top, progress_width, bar_height, | 227 bar_left, bar_top, progress_width, bar_height, |
| 228 kCornerRadius, | 228 kCornerRadius, |
| 229 0, | 229 0, |
| 230 &inner_path); | 230 &inner_path); |
| 231 canvas->ClipPath(inner_path); | 231 canvas->ClipPath(inner_path, false); |
| 232 | 232 |
| 233 const SkColor bar_colors[] = { | 233 const SkColor bar_colors[] = { |
| 234 kBarTopColor, | 234 kBarTopColor, |
| 235 kBarTopColor, | 235 kBarTopColor, |
| 236 kBarColorStart, | 236 kBarColorStart, |
| 237 kBarColorEnd, | 237 kBarColorEnd, |
| 238 kBarColorEnd, | 238 kBarColorEnd, |
| 239 }; | 239 }; |
| 240 // We want a thin 1-pixel line for kBarTopColor. | 240 // We want a thin 1-pixel line for kBarTopColor. |
| 241 SkScalar scalar_height = SkIntToScalar(bar_height); | 241 SkScalar scalar_height = SkIntToScalar(bar_height); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Draw bar stroke | 314 // Draw bar stroke |
| 315 StrokeRoundRect(canvas, | 315 StrokeRoundRect(canvas, |
| 316 bar_left, bar_top, progress_width, bar_height, | 316 bar_left, bar_top, progress_width, bar_height, |
| 317 kCornerRadius, | 317 kCornerRadius, |
| 318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, | 318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, |
| 319 kBorderWidth); | 319 kBorderWidth); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace views | 323 } // namespace views |
| OLD | NEW |