Index: ui/events/event.cc |
diff --git a/ui/events/event.cc b/ui/events/event.cc |
index 72e3bd6454f8c07f0e758015298012fb16a9f597..834d522c2caedb10a51e63f89cfceb7cbdbfae97 100644 |
--- a/ui/events/event.cc |
+++ b/ui/events/event.cc |
@@ -214,8 +214,10 @@ Event::Event(const base::NativeEvent& native_event, |
base::TimeDelta delta = EventTimeForNow() - time_stamp_; |
if (type_ < ET_LAST) |
name_ = EventTypeName(type_); |
- UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser", |
- delta.InMicroseconds(), 1, 1000000, 100); |
+ base::HistogramBase::Sample delta_sample = |
+ static_cast<base::HistogramBase::Sample>(delta.InMicroseconds()); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser", delta_sample, 1, 1000000, |
+ 100); |
std::string name_for_event = |
base::StringPrintf("Event.Latency.Browser.%s", name_.c_str()); |
base::HistogramBase* counter_for_type = |
@@ -225,7 +227,7 @@ Event::Event(const base::NativeEvent& native_event, |
1000000, |
100, |
base::HistogramBase::kUmaTargetedHistogramFlag); |
- counter_for_type->Add(delta.InMicroseconds()); |
+ counter_for_type->Add(delta_sample); |
#if defined(USE_X11) |
if (native_event->type == GenericEvent) { |
@@ -450,7 +452,8 @@ MouseWheelEvent::MouseWheelEvent(const base::NativeEvent& native_event) |
MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) |
: MouseEvent(scroll_event), |
- offset_(scroll_event.x_offset(), scroll_event.y_offset()){ |
+ offset_(static_cast<int>(scroll_event.x_offset()), |
+ static_cast<int>(scroll_event.y_offset())) { |
Peter Kasting
2014/10/17 01:47:16
Note: Perhaps the changes here and/or below should
sky
2014/10/20 15:38:33
Not sure. I suspect in practice it doesn't matter
Peter Kasting
2014/10/20 20:41:40
I think in that case I'll change these to round.
|
SetType(ET_MOUSEWHEEL); |
} |
@@ -492,10 +495,14 @@ void MouseWheelEvent::UpdateForRootTransform( |
gfx::DecomposedTransform decomp; |
bool success = gfx::DecomposeTransform(&decomp, inverted_root_transform); |
DCHECK(success); |
- if (decomp.scale[0]) |
- offset_.set_x(offset_.x() * decomp.scale[0]); |
- if (decomp.scale[1]) |
- offset_.set_y(offset_.y() * decomp.scale[1]); |
+ if (decomp.scale[0]) { |
+ offset_.set_x( |
+ static_cast<int>(SkMScalarToFloat(offset_.x() * decomp.scale[0]))); |
+ } |
+ if (decomp.scale[1]) { |
+ offset_.set_y( |
+ static_cast<int>(SkMScalarToFloat(offset_.y() * decomp.scale[1]))); |
+ } |
} |
//////////////////////////////////////////////////////////////////////////////// |