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 |
11 #include <cstring> | 11 #include <cstring> |
12 | 12 |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/base/keycodes/keyboard_code_conversion.h" | 14 #include "ui/base/keycodes/keyboard_code_conversion.h" |
15 #include "ui/gfx/point3.h" | 15 #include "ui/gfx/point3.h" |
| 16 #include "ui/gfx/interpolated_transform.h" |
16 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
17 | 18 |
18 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
19 #include "ui/aura/event_mac.h" | 20 #include "ui/aura/event_mac.h" |
20 #endif | 21 #endif |
21 | 22 |
22 #if defined(USE_X11) | 23 #if defined(USE_X11) |
23 #include "ui/base/keycodes/keyboard_code_conversion_x.h" | 24 #include "ui/base/keycodes/keyboard_code_conversion_x.h" |
24 #endif | 25 #endif |
25 | 26 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 radius_x_(1.0f), | 274 radius_x_(1.0f), |
274 radius_y_(1.0f), | 275 radius_y_(1.0f), |
275 rotation_angle_(0.0f), | 276 rotation_angle_(0.0f), |
276 force_(0.0f) { | 277 force_(0.0f) { |
277 set_time_stamp(time_stamp); | 278 set_time_stamp(time_stamp); |
278 } | 279 } |
279 | 280 |
280 TouchEvent::~TouchEvent() { | 281 TouchEvent::~TouchEvent() { |
281 } | 282 } |
282 | 283 |
| 284 void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) { |
| 285 LocatedEvent::UpdateForRootTransform(root_transform); |
| 286 gfx::Point3f scale; |
| 287 ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale); |
| 288 radius_x_ *= scale.x(); |
| 289 radius_y_ *= scale.y(); |
| 290 } |
| 291 |
283 ui::EventType TouchEvent::GetEventType() const { | 292 ui::EventType TouchEvent::GetEventType() const { |
284 return type(); | 293 return type(); |
285 } | 294 } |
286 | 295 |
287 gfx::Point TouchEvent::GetLocation() const { | 296 gfx::Point TouchEvent::GetLocation() const { |
288 return location(); | 297 return location(); |
289 } | 298 } |
290 | 299 |
291 int TouchEvent::GetTouchId() const { | 300 int TouchEvent::GetTouchId() const { |
292 return touch_id_; | 301 return touch_id_; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 int GestureEvent::GetLowestTouchId() const { | 466 int GestureEvent::GetLowestTouchId() const { |
458 if (touch_ids_bitfield_ == 0) | 467 if (touch_ids_bitfield_ == 0) |
459 return -1; | 468 return -1; |
460 int i = -1; | 469 int i = -1; |
461 // Find the index of the least significant 1 bit | 470 // Find the index of the least significant 1 bit |
462 while (!(1 << ++i & touch_ids_bitfield_)); | 471 while (!(1 << ++i & touch_ids_bitfield_)); |
463 return i; | 472 return i; |
464 } | 473 } |
465 | 474 |
466 } // namespace aura | 475 } // namespace aura |
OLD | NEW |