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

Side by Side Diff: ui/views/controls/progress_bar.cc

Issue 290333012: [Win] Draw the circular avatar programmatically rather than with a frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing virtual keyword Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/canvas.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698