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

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

Issue 11369144: ui: Make gfx::Point::Scale() mutate the class, similar to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for aura Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer_impl.cc » ('j') | cc/layer_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_uma.h" 5 #include "ash/touch/touch_uma.h"
6 6
7 #include "ash/shell_delegate.h" 7 #include "ash/shell_delegate.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "ui/aura/root_window.h" 10 #include "ui/aura/root_window.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 static_cast<XIDeviceEvent*>(xevent->xcookie.data); 311 static_cast<XIDeviceEvent*>(xevent->xcookie.data);
312 position.SetPoint(static_cast<int>(device_event->event_x), 312 position.SetPoint(static_cast<int>(device_event->event_x),
313 static_cast<int>(device_event->event_y)); 313 static_cast<int>(device_event->event_y));
314 } else { 314 } else {
315 position = ui::EventLocationFromNative(event.native_event()); 315 position = ui::EventLocationFromNative(event.native_event());
316 } 316 }
317 #else 317 #else
318 position = ui::EventLocationFromNative(event.native_event()); 318 position = ui::EventLocationFromNative(event.native_event());
319 #endif 319 #endif
320 position = gfx::ToFlooredPoint( 320 position = gfx::ToFlooredPoint(
321 position.Scale(1. / target->layer()->device_scale_factor())); 321 gfx::ScalePoint(position, 1. / target->layer()->device_scale_factor()));
322 } 322 }
323 323
324 position.set_x(std::min(bounds.width() - 1, std::max(0, position.x()))); 324 position.set_x(std::min(bounds.width() - 1, std::max(0, position.x())));
325 position.set_y(std::min(bounds.height() - 1, std::max(0, position.y()))); 325 position.set_y(std::min(bounds.height() - 1, std::max(0, position.y())));
326 326
327 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionX", 327 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionX",
328 position.x() / bucket_size_x, 328 position.x() / bucket_size_x,
329 0, kBucketCountForLocation, kBucketCountForLocation + 1); 329 0, kBucketCountForLocation, kBucketCountForLocation + 1);
330 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionY", 330 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionY",
331 position.y() / bucket_size_y, 331 position.y() / bucket_size_y,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchMoveSteps", distance, 1, 1000, 50); 384 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchMoveSteps", distance, 1, 1000, 50);
385 385
386 details->last_move_time_[event.touch_id()] = event.time_stamp(); 386 details->last_move_time_[event.touch_id()] = event.time_stamp();
387 details->last_touch_position_[event.touch_id()] = event.location(); 387 details->last_touch_position_[event.touch_id()] = event.location();
388 } 388 }
389 } 389 }
390 390
391 } // namespace internal 391 } // namespace internal
392 } // namespace ash 392 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | cc/layer_impl.cc » ('j') | cc/layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698