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

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

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/image_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/focusable_rounded_border_mac.h" 5 #include "ui/views/controls/focusable_rounded_border_mac.h"
6 6
7 #include "ui/gfx/canvas.h" 7 #include "ui/gfx/canvas.h"
8 #include "ui/native_theme/native_theme_mac.h" 8 #include "ui/native_theme/native_theme_mac.h"
9 9
10 namespace { 10 namespace {
(...skipping 10 matching lines...) Expand all
21 // padding. Why is that? 21 // padding. Why is that?
22 SetInsets(kThickness, kThickness, kThickness, kThickness); 22 SetInsets(kThickness, kThickness, kThickness, kThickness);
23 } 23 }
24 24
25 FocusableRoundedBorder::~FocusableRoundedBorder() {} 25 FocusableRoundedBorder::~FocusableRoundedBorder() {}
26 26
27 // For now, this is similar to RoundedRectBorder::Paint(), but this method will 27 // For now, this is similar to RoundedRectBorder::Paint(), but this method will
28 // likely diverge in future. 28 // likely diverge in future.
29 // TODO(ellyjones): Diverge it by adding soft focus rings. 29 // TODO(ellyjones): Diverge it by adding soft focus rings.
30 void FocusableRoundedBorder::Paint(const View& view, gfx::Canvas* canvas) { 30 void FocusableRoundedBorder::Paint(const View& view, gfx::Canvas* canvas) {
31 SkPaint paint; 31 cc::PaintFlags paint;
32 paint.setStyle(SkPaint::kStroke_Style); 32 paint.setStyle(cc::PaintFlags::kStroke_Style);
33 paint.setStrokeWidth(kThickness); 33 paint.setStrokeWidth(kThickness);
34 paint.setColor(GetCurrentColor(view)); 34 paint.setColor(GetCurrentColor(view));
35 paint.setAntiAlias(true); 35 paint.setAntiAlias(true);
36 36
37 float half_thickness = kThickness / 2.0f; 37 float half_thickness = kThickness / 2.0f;
38 gfx::RectF bounds(view.GetLocalBounds()); 38 gfx::RectF bounds(view.GetLocalBounds());
39 bounds.Inset(half_thickness, half_thickness); 39 bounds.Inset(half_thickness, half_thickness);
40 canvas->DrawRoundRect(bounds, ui::NativeThemeMac::kButtonCornerRadius, 40 canvas->DrawRoundRect(bounds, ui::NativeThemeMac::kButtonCornerRadius,
41 paint); 41 paint);
42 } 42 }
43 43
44 } // namespace views 44 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698