OLD | NEW |
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 "ui/aura/event.h" | 5 #include "ui/aura/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if (target && target != source) | 112 if (target && target != source) |
113 Window::ConvertPointToWindow(source, target, &location_); | 113 Window::ConvertPointToWindow(source, target, &location_); |
114 } | 114 } |
115 | 115 |
116 LocatedEvent::LocatedEvent(ui::EventType type, | 116 LocatedEvent::LocatedEvent(ui::EventType type, |
117 const gfx::Point& location, | 117 const gfx::Point& location, |
118 const gfx::Point& root_location, | 118 const gfx::Point& root_location, |
119 int flags) | 119 int flags) |
120 : Event(type, flags), | 120 : Event(type, flags), |
121 location_(location), | 121 location_(location), |
122 root_location_(location) { | 122 root_location_(root_location) { |
123 } | 123 } |
124 | 124 |
125 void LocatedEvent::UpdateForRootTransform(const ui::Transform& root_transform) { | 125 void LocatedEvent::UpdateForRootTransform(const ui::Transform& root_transform) { |
126 // Transform has to be done at root level. | 126 // Transform has to be done at root level. |
127 DCHECK_EQ(root_location_.x(), location_.x()); | 127 DCHECK_EQ(root_location_.x(), location_.x()); |
128 DCHECK_EQ(root_location_.y(), location_.y()); | 128 DCHECK_EQ(root_location_.y(), location_.y()); |
129 gfx::Point3f p(location_); | 129 gfx::Point3f p(location_); |
130 root_transform.TransformPointReverse(p); | 130 root_transform.TransformPointReverse(p); |
131 root_location_ = location_ = p.AsPoint(); | 131 root_location_ = location_ = p.AsPoint(); |
132 } | 132 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 int GestureEvent::GetLowestTouchId() const { | 470 int GestureEvent::GetLowestTouchId() const { |
471 if (touch_ids_bitfield_ == 0) | 471 if (touch_ids_bitfield_ == 0) |
472 return -1; | 472 return -1; |
473 int i = -1; | 473 int i = -1; |
474 // Find the index of the least significant 1 bit | 474 // Find the index of the least significant 1 bit |
475 while (!(1 << ++i & touch_ids_bitfield_)); | 475 while (!(1 << ++i & touch_ids_bitfield_)); |
476 return i; | 476 return i; |
477 } | 477 } |
478 | 478 |
479 } // namespace aura | 479 } // namespace aura |
OLD | NEW |