| 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 "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 SkScalar y = SkIntToScalar(location.y()); | 301 SkScalar y = SkIntToScalar(location.y()); |
| 302 SkPoint last; | 302 SkPoint last; |
| 303 if (!paths_[trace_index].getLastPt(&last) || x != last.x() || | 303 if (!paths_[trace_index].getLastPt(&last) || x != last.x() || |
| 304 y != last.y()) { | 304 y != last.y()) { |
| 305 paths_[trace_index].addCircle(x, y, SkIntToScalar(kPointRadius)); | 305 paths_[trace_index].addCircle(x, y, SkIntToScalar(kPointRadius)); |
| 306 SchedulePaint(); | 306 SchedulePaint(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 // Overridden from views::View. | 310 // Overridden from views::View. |
| 311 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 311 virtual void OnPaint(gfx::Canvas* canvas) override { |
| 312 for (int i = 0; i < kMaxPaths; ++i) { | 312 for (int i = 0; i < kMaxPaths; ++i) { |
| 313 if (paths_[i].countPoints() == 0) | 313 if (paths_[i].countPoints() == 0) |
| 314 continue; | 314 continue; |
| 315 paint_.setColor(colors_[i]); | 315 paint_.setColor(colors_[i]); |
| 316 canvas->DrawPath(paths_[i], paint_); | 316 canvas->DrawPath(paths_[i], paint_); |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 SkPaint paint_; | 320 SkPaint paint_; |
| 321 | 321 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 RootWindowController* controller) { | 479 RootWindowController* controller) { |
| 480 controller->set_touch_hud_debug(this); | 480 controller->set_touch_hud_debug(this); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void TouchHudDebug::UnsetHudForRootWindowController( | 483 void TouchHudDebug::UnsetHudForRootWindowController( |
| 484 RootWindowController* controller) { | 484 RootWindowController* controller) { |
| 485 controller->set_touch_hud_debug(NULL); | 485 controller->set_touch_hud_debug(NULL); |
| 486 } | 486 } |
| 487 | 487 |
| 488 } // namespace ash | 488 } // namespace ash |
| OLD | NEW |