OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/touch_hud/touch_hud_renderer.h" | 5 #include "ash/touch_hud/touch_hud_renderer.h" |
6 | 6 |
7 #include "third_party/skia/include/effects/SkGradientShader.h" | 7 #include "third_party/skia/include/effects/SkGradientShader.h" |
8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
9 #include "ui/compositor/layer_owner.h" | 9 #include "ui/compositor/layer_owner.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 public views::WidgetObserver { | 33 public views::WidgetObserver { |
34 public: | 34 public: |
35 explicit TouchPointView(views::Widget* parent_widget) | 35 explicit TouchPointView(views::Widget* parent_widget) |
36 : circle_center_(kPointRadius + 1, kPointRadius + 1), | 36 : circle_center_(kPointRadius + 1, kPointRadius + 1), |
37 gradient_center_(SkPoint::Make(kPointRadius + 1, kPointRadius + 1)) { | 37 gradient_center_(SkPoint::Make(kPointRadius + 1, kPointRadius + 1)) { |
38 SetPaintToLayer(); | 38 SetPaintToLayer(); |
39 layer()->SetFillsBoundsOpaquely(false); | 39 layer()->SetFillsBoundsOpaquely(false); |
40 | 40 |
41 SetSize(gfx::Size(2 * kPointRadius + 2, 2 * kPointRadius + 2)); | 41 SetSize(gfx::Size(2 * kPointRadius + 2, 2 * kPointRadius + 2)); |
42 | 42 |
43 stroke_paint_.setStyle(SkPaint::kStroke_Style); | 43 stroke_paint_.setStyle(cc::PaintFlags::kStroke_Style); |
44 stroke_paint_.setColor(kProjectionStrokeColor); | 44 stroke_paint_.setColor(kProjectionStrokeColor); |
45 | 45 |
46 gradient_colors_[0] = kProjectionFillColor; | 46 gradient_colors_[0] = kProjectionFillColor; |
47 gradient_colors_[1] = kProjectionStrokeColor; | 47 gradient_colors_[1] = kProjectionStrokeColor; |
48 | 48 |
49 gradient_pos_[0] = SkFloatToScalar(0.9f); | 49 gradient_pos_[0] = SkFloatToScalar(0.9f); |
50 gradient_pos_[1] = SkFloatToScalar(1.0f); | 50 gradient_pos_[1] = SkFloatToScalar(1.0f); |
51 | 51 |
52 parent_widget->GetContentsView()->AddChildView(this); | 52 parent_widget->GetContentsView()->AddChildView(this); |
53 | 53 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 void OnWidgetDestroying(views::Widget* widget) override { | 113 void OnWidgetDestroying(views::Widget* widget) override { |
114 if (fadeout_) | 114 if (fadeout_) |
115 fadeout_->Stop(); | 115 fadeout_->Stop(); |
116 else | 116 else |
117 Destroy(); | 117 Destroy(); |
118 } | 118 } |
119 | 119 |
120 const gfx::Point circle_center_; | 120 const gfx::Point circle_center_; |
121 const SkPoint gradient_center_; | 121 const SkPoint gradient_center_; |
122 | 122 |
123 SkPaint fill_paint_; | 123 cc::PaintFlags fill_paint_; |
sky
2017/01/26 23:00:13
Similar comment about naming for these two.
| |
124 SkPaint stroke_paint_; | 124 cc::PaintFlags stroke_paint_; |
125 SkColor gradient_colors_[2]; | 125 SkColor gradient_colors_[2]; |
126 SkScalar gradient_pos_[2]; | 126 SkScalar gradient_pos_[2]; |
127 | 127 |
128 std::unique_ptr<gfx::Animation> fadeout_; | 128 std::unique_ptr<gfx::Animation> fadeout_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(TouchPointView); | 130 DISALLOW_COPY_AND_ASSIGN(TouchPointView); |
131 }; | 131 }; |
132 | 132 |
133 TouchHudRenderer::TouchHudRenderer(views::Widget* parent_widget) | 133 TouchHudRenderer::TouchHudRenderer(views::Widget* parent_widget) |
134 : parent_widget_(parent_widget) {} | 134 : parent_widget_(parent_widget) {} |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 if (event.type() == ui::ET_TOUCH_RELEASED || | 171 if (event.type() == ui::ET_TOUCH_RELEASED || |
172 event.type() == ui::ET_TOUCH_CANCELLED || | 172 event.type() == ui::ET_TOUCH_CANCELLED || |
173 event.type() == ui::ET_POINTER_UP || | 173 event.type() == ui::ET_POINTER_UP || |
174 event.type() == ui::ET_POINTER_CANCELLED) | 174 event.type() == ui::ET_POINTER_CANCELLED) |
175 points_.erase(iter); | 175 points_.erase(iter); |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace ash | 180 } // namespace ash |
OLD | NEW |