| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 return WebTouchPoint::StateMoved; | 447 return WebTouchPoint::StateMoved; |
| 448 return WebTouchPoint::StateUndefined; | 448 return WebTouchPoint::StateUndefined; |
| 449 } | 449 } |
| 450 | 450 |
| 451 // TODO(mustaq): Add tests for this. | 451 // TODO(mustaq): Add tests for this. |
| 452 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo
uchPoint& point) | 452 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo
uchPoint& point) |
| 453 { | 453 { |
| 454 m_pointerProperties = point; | 454 m_pointerProperties = point; |
| 455 m_state = toPlatformTouchPointState(point.state); | 455 m_state = toPlatformTouchPointState(point.state); |
| 456 | 456 |
| 457 // This assumes convertFromRootFrame does only translations, not scales. | |
| 458 FloatPoint floatPos = convertHitPointToRootFrame(widget, point.position); | 457 FloatPoint floatPos = convertHitPointToRootFrame(widget, point.position); |
| 459 IntPoint flooredPoint = flooredIntPoint(floatPos); | 458 IntPoint flooredPoint = flooredIntPoint(floatPos); |
| 460 m_pos = widget->convertFromRootFrame(flooredPoint) + (floatPos - flooredPoin
t); | 459 m_pos = widget->convertFromRootFrame(flooredPoint) + (floatPos - flooredPoin
t); |
| 461 | 460 |
| 462 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y); | 461 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y); |
| 463 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY)
); | 462 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY)
); |
| 464 m_rotationAngle = point.rotationAngle; | 463 m_rotationAngle = point.rotationAngle; |
| 465 } | 464 } |
| 466 | 465 |
| 467 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo
uchEvent& event) | 466 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo
uchEvent& event) |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 break; | 800 break; |
| 802 case GestureSourceTouchscreen: | 801 case GestureSourceTouchscreen: |
| 803 sourceDevice = WebGestureDeviceTouchscreen; | 802 sourceDevice = WebGestureDeviceTouchscreen; |
| 804 break; | 803 break; |
| 805 case GestureSourceUninitialized: | 804 case GestureSourceUninitialized: |
| 806 NOTREACHED(); | 805 NOTREACHED(); |
| 807 } | 806 } |
| 808 } | 807 } |
| 809 | 808 |
| 810 } // namespace blink | 809 } // namespace blink |
| OLD | NEW |