Commit a66e18e7 authored by tdresser@chromium.org's avatar tdresser@chromium.org

Chrome allows WebTouchPoint to store WebFloatPoint, instead of WebPoint.

This is the first of three patches converting WebTouchPoint to use
WebFloatPoint instead of WebPoint. This introduces some temporary
casts to WebPoint in chromium, which will be removed as soon as
blink has WebTouchPoint storing it's location in a WebFloatPoint.

The second patch (https://codereview.chromium.org/149053002/) 
will be a blink modification to store WebFloatPoint,
and the third patch (https://codereview.chromium.org/148453012/) 
will clean up the chromium side.

BUG=336807

Review URL: https://codereview.chromium.org/140973005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247739 0039d316-1c4b-4281-b951-d872f2087c98
parent 46924b47
...@@ -222,9 +222,11 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( ...@@ -222,9 +222,11 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
for (size_t i = 0; i < touch_event.touchesLength; ++i) { for (size_t i = 0; i < touch_event.touchesLength; ++i) {
if (touch_event.touches[i].state != WebTouchPoint::StatePressed) if (touch_event.touches[i].state != WebTouchPoint::StatePressed)
continue; continue;
if (input_handler_->HaveTouchEventHandlersAt(touch_event.touches[i] if (input_handler_->HaveTouchEventHandlersAt(
.position)) blink::WebPoint(touch_event.touches[i].position.x,
touch_event.touches[i].position.y))) {
return DID_NOT_HANDLE; return DID_NOT_HANDLE;
}
} }
return DROP_EVENT; return DROP_EVENT;
} else if (WebInputEvent::isKeyboardEventType(event.type)) { } else if (WebInputEvent::isKeyboardEventType(event.type)) {
......
...@@ -1140,7 +1140,9 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, ...@@ -1140,7 +1140,9 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
for (size_t i = 0; i < touch_event.touchesLength; ++i) { for (size_t i = 0; i < touch_event.touchesLength; ++i) {
if (touch_event.touches[i].state == WebTouchPoint::StatePressed && if (touch_event.touches[i].state == WebTouchPoint::StatePressed &&
HasTouchEventHandlersAt(touch_event.touches[i].position)) { HasTouchEventHandlersAt(
blink::WebPoint(touch_event.touches[i].position.x,
touch_event.touches[i].position.y))) {
ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
break; break;
} }
......
...@@ -967,7 +967,8 @@ void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re ...@@ -967,7 +967,8 @@ void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re
WebTouchPoint touchPoint; WebTouchPoint touchPoint;
touchPoint.state = WebTouchPoint::StatePressed; touchPoint.state = WebTouchPoint::StatePressed;
touchPoint.position = WebPoint(arguments[0].toInt32(), arguments[1].toInt32()); touchPoint.position.x = arguments[0].toInt32();
touchPoint.position.y = arguments[1].toInt32();
touchPoint.screenPosition = touchPoint.position; touchPoint.screenPosition = touchPoint.position;
if (arguments.size() > 2) { if (arguments.size() > 2) {
...@@ -1034,11 +1035,11 @@ void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant* ...@@ -1034,11 +1035,11 @@ void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant*
const unsigned index = arguments[0].toInt32(); const unsigned index = arguments[0].toInt32();
BLINK_ASSERT(index < touchPoints.size()); BLINK_ASSERT(index < touchPoints.size());
WebPoint position(arguments[1].toInt32(), arguments[2].toInt32());
WebTouchPoint* touchPoint = &touchPoints[index]; WebTouchPoint* touchPoint = &touchPoints[index];
touchPoint->state = WebTouchPoint::StateMoved; touchPoint->state = WebTouchPoint::StateMoved;
touchPoint->position = position; touchPoint->position.x = arguments[1].toInt32();
touchPoint->screenPosition = position; touchPoint->position.y = arguments[2].toInt32();
touchPoint->screenPosition = touchPoint->position;
} }
void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant* result) void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant* result)
......
...@@ -85,7 +85,7 @@ void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int ...@@ -85,7 +85,7 @@ void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int
{ {
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
char buffer[100]; char buffer[100];
snprintf(buffer, sizeof(buffer), "* %d, %d: %s\n", points[i].position.x, points[i].position.y, pointState(points[i].state)); snprintf(buffer, sizeof(buffer), "* %d, %d: %s\n", static_cast<int>(points[i].position.x), static_cast<int>(points[i].position.y), pointState(points[i].state));
delegate->printMessage(buffer); delegate->printMessage(buffer);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment