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

Unified Diff: components/exo/wayland/server.cc

Issue 2560633002: exo: Implement v6 of touch protocol including shape and frame event (Closed)
Patch Set: extend event_generator to test touch radius Created 4 years 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
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index 877e56c3867e29db172c7a33917205ec2fd45c26..620d1f285fc9af8d8cb9e50a3d789160002de02c 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -2386,12 +2386,10 @@ class WaylandTouchDelegate : public TouchDelegate {
TimeTicksToMilliseconds(time_stamp), surface_resource,
id, wl_fixed_from_int(location.x()),
wl_fixed_from_int(location.y()));
- wl_client_flush(client());
}
void OnTouchUp(base::TimeTicks time_stamp, int id) override {
wl_touch_send_up(touch_resource_, next_serial(),
TimeTicksToMilliseconds(time_stamp), id);
- wl_client_flush(client());
}
void OnTouchMotion(base::TimeTicks time_stamp,
int id,
@@ -2399,11 +2397,23 @@ class WaylandTouchDelegate : public TouchDelegate {
wl_touch_send_motion(touch_resource_, TimeTicksToMilliseconds(time_stamp),
id, wl_fixed_from_int(location.x()),
wl_fixed_from_int(location.y()));
+ }
+ void OnTouchShape(int id, float major, float minor) override {
+ if (wl_resource_get_version(touch_resource_) >=
+ WL_TOUCH_SHAPE_SINCE_VERSION) {
+ wl_touch_send_shape(touch_resource_, id, wl_fixed_from_double(major),
+ wl_fixed_from_double(minor));
+ }
+ }
+ void OnTouchFrame() override {
+ if (wl_resource_get_version(touch_resource_) >=
+ WL_TOUCH_FRAME_SINCE_VERSION) {
+ wl_touch_send_frame(touch_resource_);
+ }
wl_client_flush(client());
}
void OnTouchCancel() override {
wl_touch_send_cancel(touch_resource_);
- wl_client_flush(client());
}
private:

Powered by Google App Engine
This is Rietveld 408576698