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

Side by Side Diff: ash/autoclick/common/autoclick_ring_handler.cc

Issue 2679423002: ash: Clean up naming of paint-related identifiers (Closed)
Patch Set: 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 | « no previous file | ash/common/accelerators/debug_commands.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 "ash/autoclick/common/autoclick_ring_handler.h" 5 #include "ash/autoclick/common/autoclick_ring_handler.h"
6 6
7 #include "third_party/skia/include/core/SkColor.h" 7 #include "third_party/skia/include/core/SkColor.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "third_party/skia/include/core/SkRect.h" 9 #include "third_party/skia/include/core/SkRect.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 27 matching lines...) Expand all
38 // completes at the end of the animation. 38 // completes at the end of the animation.
39 const int kAutoclickRingAngleEndValue = 360; 39 const int kAutoclickRingAngleEndValue = 360;
40 40
41 // Visual constants. 41 // Visual constants.
42 const SkColor kAutoclickRingArcColor = SkColorSetARGB(255, 0, 255, 0); 42 const SkColor kAutoclickRingArcColor = SkColorSetARGB(255, 0, 255, 0);
43 const SkColor kAutoclickRingCircleColor = SkColorSetARGB(255, 0, 0, 255); 43 const SkColor kAutoclickRingCircleColor = SkColorSetARGB(255, 0, 0, 255);
44 44
45 void PaintAutoclickRingCircle(gfx::Canvas* canvas, 45 void PaintAutoclickRingCircle(gfx::Canvas* canvas,
46 gfx::Point& center, 46 gfx::Point& center,
47 int radius) { 47 int radius) {
48 cc::PaintFlags paint; 48 cc::PaintFlags flags;
49 paint.setStyle(cc::PaintFlags::kStroke_Style); 49 flags.setStyle(cc::PaintFlags::kStroke_Style);
50 paint.setStrokeWidth(2 * kAutoclickRingArcWidth); 50 flags.setStrokeWidth(2 * kAutoclickRingArcWidth);
51 paint.setColor(kAutoclickRingCircleColor); 51 flags.setColor(kAutoclickRingCircleColor);
52 paint.setAntiAlias(true); 52 flags.setAntiAlias(true);
53 53
54 canvas->DrawCircle(center, radius, paint); 54 canvas->DrawCircle(center, radius, flags);
55 } 55 }
56 56
57 void PaintAutoclickRingArc(gfx::Canvas* canvas, 57 void PaintAutoclickRingArc(gfx::Canvas* canvas,
58 const gfx::Point& center, 58 const gfx::Point& center,
59 int radius, 59 int radius,
60 int start_angle, 60 int start_angle,
61 int end_angle) { 61 int end_angle) {
62 cc::PaintFlags paint; 62 cc::PaintFlags flags;
63 paint.setStyle(cc::PaintFlags::kStroke_Style); 63 flags.setStyle(cc::PaintFlags::kStroke_Style);
64 paint.setStrokeWidth(2 * kAutoclickRingArcWidth); 64 flags.setStrokeWidth(2 * kAutoclickRingArcWidth);
65 paint.setColor(kAutoclickRingArcColor); 65 flags.setColor(kAutoclickRingArcColor);
66 paint.setAntiAlias(true); 66 flags.setAntiAlias(true);
67 67
68 SkPath arc_path; 68 SkPath arc_path;
69 arc_path.addArc(SkRect::MakeXYWH(center.x() - radius, center.y() - radius, 69 arc_path.addArc(SkRect::MakeXYWH(center.x() - radius, center.y() - radius,
70 2 * radius, 2 * radius), 70 2 * radius, 2 * radius),
71 start_angle, end_angle - start_angle); 71 start_angle, end_angle - start_angle);
72 canvas->DrawPath(arc_path, paint); 72 canvas->DrawPath(arc_path, flags);
73 } 73 }
74 } // namespace 74 } // namespace
75 75
76 // View of the AutoclickRingHandler. Draws the actual contents and updates as 76 // View of the AutoclickRingHandler. Draws the actual contents and updates as
77 // the animation proceeds. It also maintains the views::Widget that the 77 // the animation proceeds. It also maintains the views::Widget that the
78 // animation is shown in. 78 // animation is shown in.
79 class AutoclickRingHandler::AutoclickRingView : public views::View { 79 class AutoclickRingHandler::AutoclickRingView : public views::View {
80 public: 80 public:
81 AutoclickRingView(const gfx::Point& event_location, 81 AutoclickRingView(const gfx::Point& event_location,
82 views::Widget* ring_widget) 82 views::Widget* ring_widget)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 current_animation_type_ = AnimationType::NONE; 256 current_animation_type_ = AnimationType::NONE;
257 break; 257 break;
258 case AnimationType::NONE: 258 case AnimationType::NONE:
259 // fall through to reset the view. 259 // fall through to reset the view.
260 view_.reset(); 260 view_.reset();
261 break; 261 break;
262 } 262 }
263 } 263 }
264 264
265 } // namespace ash 265 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/accelerators/debug_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698