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

Side by Side Diff: ash/touch/touch_hud_debug.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: Refactor Created 3 years, 11 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
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
11 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "base/json/json_string_value_serializer.h" 13 #include "base/json/json_string_value_serializer.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "third_party/skia/include/core/SkPath.h" 17 #include "third_party/skia/include/core/SkPath.h"
18 #include "ui/aura/window_event_dispatcher.h" 18 #include "ui/aura/window_event_dispatcher.h"
19 #include "ui/compositor/layer_type.h"
19 #include "ui/display/display.h" 20 #include "ui/display/display.h"
20 #include "ui/display/manager/display_manager.h" 21 #include "ui/display/manager/display_manager.h"
21 #include "ui/events/event.h" 22 #include "ui/events/event.h"
22 #include "ui/gfx/animation/animation_delegate.h" 23 #include "ui/gfx/animation/animation_delegate.h"
23 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
24 #include "ui/gfx/geometry/size.h" 25 #include "ui/gfx/geometry/size.h"
25 #include "ui/gfx/geometry/vector2d.h" 26 #include "ui/gfx/geometry/vector2d.h"
26 #include "ui/gfx/transform.h" 27 #include "ui/gfx/transform.h"
27 #include "ui/views/controls/label.h" 28 #include "ui/views/controls/label.h"
28 #include "ui/views/layout/box_layout.h" 29 #include "ui/views/layout/box_layout.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 std::map<int, int> touch_id_to_trace_index_; 232 std::map<int, int> touch_id_to_trace_index_;
232 233
233 DISALLOW_COPY_AND_ASSIGN(TouchLog); 234 DISALLOW_COPY_AND_ASSIGN(TouchLog);
234 }; 235 };
235 236
236 // TouchHudCanvas draws touch traces in |FULLSCREEN| and |REDUCED_SCALE| modes. 237 // TouchHudCanvas draws touch traces in |FULLSCREEN| and |REDUCED_SCALE| modes.
237 class TouchHudCanvas : public views::View { 238 class TouchHudCanvas : public views::View {
238 public: 239 public:
239 explicit TouchHudCanvas(const TouchLog& touch_log) 240 explicit TouchHudCanvas(const TouchLog& touch_log)
240 : touch_log_(touch_log), scale_(1) { 241 : touch_log_(touch_log), scale_(1) {
241 SetPaintToLayer(true); 242 SetPaintToLayer(ui::LAYER_TEXTURED);
242 layer()->SetFillsBoundsOpaquely(false); 243 layer()->SetFillsBoundsOpaquely(false);
243 244
244 paint_.setStyle(SkPaint::kFill_Style); 245 paint_.setStyle(SkPaint::kFill_Style);
245 } 246 }
246 247
247 ~TouchHudCanvas() override {} 248 ~TouchHudCanvas() override {}
248 249
249 void SetScale(int scale) { 250 void SetScale(int scale) {
250 if (scale_ == scale) 251 if (scale_ == scale)
251 return; 252 return;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 RootWindowController* controller) { 464 RootWindowController* controller) {
464 controller->set_touch_hud_debug(this); 465 controller->set_touch_hud_debug(this);
465 } 466 }
466 467
467 void TouchHudDebug::UnsetHudForRootWindowController( 468 void TouchHudDebug::UnsetHudForRootWindowController(
468 RootWindowController* controller) { 469 RootWindowController* controller) {
469 controller->set_touch_hud_debug(NULL); 470 controller->set_touch_hud_debug(NULL);
470 } 471 }
471 472
472 } // namespace ash 473 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698