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

Unified Diff: ui/events/test/event_generator.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-event: mandol_line Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.cc ('k') | ui/events/test/events_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/event_generator.cc
diff --git a/ui/events/test/event_generator.cc b/ui/events/test/event_generator.cc
index 84b53ab97a01c7dcc6e7556c9672459654bb68df..08c8d18f20ffdc1ebba29f40fac60da9a14ccc2e 100644
--- a/ui/events/test/event_generator.cc
+++ b/ui/events/test/event_generator.cc
@@ -63,7 +63,7 @@ class TestTouchEvent : public ui::TouchEvent {
int flags,
base::TimeDelta timestamp)
: TouchEvent(type,
- gfx::PointF(root_location),
+ root_location,
flags,
touch_id,
timestamp,
@@ -164,7 +164,7 @@ void EventGenerator::ReleaseRightButton() {
}
void EventGenerator::MoveMouseWheel(int delta_x, int delta_y) {
- auto location = gfx::PointF(GetLocationInCurrentRoot());
+ gfx::Point location = GetLocationInCurrentRoot();
ui::MouseEvent mouseev(ui::ET_MOUSEWHEEL, location, location,
ui::EventTimeForNow(), flags_, 0);
ui::MouseWheelEvent wheelev(mouseev, delta_x, delta_y);
@@ -370,11 +370,13 @@ void EventGenerator::GestureScrollSequenceWithCallback(
float dx = static_cast<float>(end.x() - start.x()) / steps;
float dy = static_cast<float>(end.y() - start.y()) / steps;
- gfx::PointF location = start;
+ gfx::PointF location(start);
for (int i = 0; i < steps; ++i) {
location.Offset(dx, dy);
timestamp += step_delay;
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, location, kTouchId, timestamp);
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(), kTouchId, timestamp);
+ move.set_location_f(location);
+ move.set_root_location_f(location);
Dispatch(&move);
callback.Run(ui::ET_GESTURE_SCROLL_UPDATE, gfx::Vector2dF(dx, dy));
}
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.cc ('k') | ui/events/test/events_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698