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/touch_hud_debug.h" | 5 #include "ash/touch/touch_hud_debug.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 }; | 234 }; |
235 | 235 |
236 // TouchHudCanvas draws touch traces in |FULLSCREEN| and |REDUCED_SCALE| modes. | 236 // TouchHudCanvas draws touch traces in |FULLSCREEN| and |REDUCED_SCALE| modes. |
237 class TouchHudCanvas : public views::View { | 237 class TouchHudCanvas : public views::View { |
238 public: | 238 public: |
239 explicit TouchHudCanvas(const TouchLog& touch_log) | 239 explicit TouchHudCanvas(const TouchLog& touch_log) |
240 : touch_log_(touch_log), scale_(1) { | 240 : touch_log_(touch_log), scale_(1) { |
241 SetPaintToLayer(); | 241 SetPaintToLayer(); |
242 layer()->SetFillsBoundsOpaquely(false); | 242 layer()->SetFillsBoundsOpaquely(false); |
243 | 243 |
244 paint_.setStyle(SkPaint::kFill_Style); | 244 paint_.setStyle(cc::PaintFlags::kFill_Style); |
245 } | 245 } |
246 | 246 |
247 ~TouchHudCanvas() override {} | 247 ~TouchHudCanvas() override {} |
248 | 248 |
249 void SetScale(int scale) { | 249 void SetScale(int scale) { |
250 if (scale_ == scale) | 250 if (scale_ == scale) |
251 return; | 251 return; |
252 scale_ = scale; | 252 scale_ = scale; |
253 gfx::Transform transform; | 253 gfx::Transform transform; |
254 transform.Scale(1. / scale_, 1. / scale_); | 254 transform.Scale(1. / scale_, 1. / scale_); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
297 // Overridden from views::View. | 297 // Overridden from views::View. |
298 void OnPaint(gfx::Canvas* canvas) override { | 298 void OnPaint(gfx::Canvas* canvas) override { |
299 for (int i = 0; i < kMaxPaths; ++i) { | 299 for (int i = 0; i < kMaxPaths; ++i) { |
300 if (paths_[i].countPoints() == 0) | 300 if (paths_[i].countPoints() == 0) |
301 continue; | 301 continue; |
302 paint_.setColor(colors_[i]); | 302 paint_.setColor(colors_[i]); |
303 canvas->DrawPath(paths_[i], paint_); | 303 canvas->DrawPath(paths_[i], paint_); |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 SkPaint paint_; | 307 cc::PaintFlags paint_; |
sky
2017/01/26 23:00:13
If PaintFlags is going to be the final name, then
| |
308 | 308 |
309 const TouchLog& touch_log_; | 309 const TouchLog& touch_log_; |
310 SkPath paths_[kMaxPaths]; | 310 SkPath paths_[kMaxPaths]; |
311 SkColor colors_[kMaxPaths]; | 311 SkColor colors_[kMaxPaths]; |
312 | 312 |
313 int scale_; | 313 int scale_; |
314 | 314 |
315 DISALLOW_COPY_AND_ASSIGN(TouchHudCanvas); | 315 DISALLOW_COPY_AND_ASSIGN(TouchHudCanvas); |
316 }; | 316 }; |
317 | 317 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 RootWindowController* controller) { | 463 RootWindowController* controller) { |
464 controller->set_touch_hud_debug(this); | 464 controller->set_touch_hud_debug(this); |
465 } | 465 } |
466 | 466 |
467 void TouchHudDebug::UnsetHudForRootWindowController( | 467 void TouchHudDebug::UnsetHudForRootWindowController( |
468 RootWindowController* controller) { | 468 RootWindowController* controller) { |
469 controller->set_touch_hud_debug(NULL); | 469 controller->set_touch_hud_debug(NULL); |
470 } | 470 } |
471 | 471 |
472 } // namespace ash | 472 } // namespace ash |
OLD | NEW |