| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 static void addTouchPoints(const Widget* widget, const AtomicString& touchType,
TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con
st WebCore::RenderObject* renderObject) | 746 static void addTouchPoints(const Widget* widget, const AtomicString& touchType,
TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con
st WebCore::RenderObject* renderObject) |
| 747 { | 747 { |
| 748 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>
(WebTouchEvent::touchesLengthCap)); | 748 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>
(WebTouchEvent::touchesLengthCap)); |
| 749 for (unsigned i = 0; i < numberOfTouches; ++i) { | 749 for (unsigned i = 0; i < numberOfTouches; ++i) { |
| 750 const Touch* touch = touches->item(i); | 750 const Touch* touch = touches->item(i); |
| 751 | 751 |
| 752 WebTouchPoint point; | 752 WebTouchPoint point; |
| 753 point.id = touch->identifier(); | 753 point.id = touch->identifier(); |
| 754 point.screenPosition = touch->screenLocation(); | 754 point.screenPosition = touch->screenLocation(); |
| 755 point.position = convertAbsoluteLocationForRenderObjectFloat(touch->abso
luteLocation(), *renderObject); | 755 point.position = convertAbsoluteLocationForRenderObjectFloat(touch->abso
luteLocation(), *renderObject); |
| 756 point.radiusX = touch->webkitRadiusX(); | 756 point.radiusX = touch->radiusX(); |
| 757 point.radiusY = touch->webkitRadiusY(); | 757 point.radiusY = touch->radiusY(); |
| 758 point.rotationAngle = touch->webkitRotationAngle(); | 758 point.rotationAngle = touch->webkitRotationAngle(); |
| 759 point.force = touch->webkitForce(); | 759 point.force = touch->force(); |
| 760 point.state = toWebTouchPointState(touchType); | 760 point.state = toWebTouchPointState(touchType); |
| 761 | 761 |
| 762 touchPoints[i] = point; | 762 touchPoints[i] = point; |
| 763 } | 763 } |
| 764 *touchPointsLength = numberOfTouches; | 764 *touchPointsLength = numberOfTouches; |
| 765 } | 765 } |
| 766 | 766 |
| 767 WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const WebCore::
RenderObject* renderObject, const TouchEvent& event) | 767 WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const WebCore::
RenderObject* renderObject, const TouchEvent& event) |
| 768 { | 768 { |
| 769 if (event.type() == EventTypeNames::touchstart) | 769 if (event.type() == EventTypeNames::touchstart) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 modifiers = getWebInputModifiers(event); | 812 modifiers = getWebInputModifiers(event); |
| 813 | 813 |
| 814 globalX = event.screenX(); | 814 globalX = event.screenX(); |
| 815 globalY = event.screenY(); | 815 globalY = event.screenY(); |
| 816 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); | 816 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); |
| 817 x = localPoint.x(); | 817 x = localPoint.x(); |
| 818 y = localPoint.y(); | 818 y = localPoint.y(); |
| 819 } | 819 } |
| 820 | 820 |
| 821 } // namespace blink | 821 } // namespace blink |
| OLD | NEW |