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

Side by Side Diff: ash/touch/touch_hud_debug.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 | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch_hud/touch_hud_renderer.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 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
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
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_;
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
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
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch_hud/touch_hud_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698