Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: Source/web/WebInputEventConversion.cpp

Issue 1192563002: Pass real tilt information to PointerEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Spelling, passing expected.txt Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/PlatformTouchPoint.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 return WebTouchPoint::StateCancelled; 411 return WebTouchPoint::StateCancelled;
412 if (type == EventTypeNames::touchstart) 412 if (type == EventTypeNames::touchstart)
413 return WebTouchPoint::StatePressed; 413 return WebTouchPoint::StatePressed;
414 if (type == EventTypeNames::touchmove) 414 if (type == EventTypeNames::touchmove)
415 return WebTouchPoint::StateMoved; 415 return WebTouchPoint::StateMoved;
416 return WebTouchPoint::StateUndefined; 416 return WebTouchPoint::StateUndefined;
417 } 417 }
418 418
419 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo uchPoint& point) 419 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo uchPoint& point)
420 { 420 {
421 m_id = point.id; 421 m_pointerProperties = point;
422 m_state = toPlatformTouchPointState(point.state); 422 m_state = toPlatformTouchPointState(point.state);
423 423
424 // This assumes convertFromContainingWindow does only translations, not scal es. 424 // This assumes convertFromContainingWindow does only translations, not scal es.
425 FloatPoint floatPos = convertHitPointToWindow(widget, point.position); 425 FloatPoint floatPos = convertHitPointToWindow(widget, point.position);
426 IntPoint flooredPoint = flooredIntPoint(floatPos); 426 IntPoint flooredPoint = flooredIntPoint(floatPos);
427 m_pos = widget->convertFromContainingWindow(flooredPoint) + (floatPos - floo redPoint); 427 m_pos = widget->convertFromContainingWindow(flooredPoint) + (floatPos - floo redPoint);
428 428
429 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y); 429 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y);
430 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY) ); 430 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY) );
431 m_rotationAngle = point.rotationAngle; 431 m_rotationAngle = point.rotationAngle;
432 m_force = point.force;
433 } 432 }
434 433
435 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo uchEvent& event) 434 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo uchEvent& event)
436 { 435 {
437 m_type = toPlatformTouchEventType(event.type); 436 m_type = toPlatformTouchEventType(event.type);
438 m_modifiers = toPlatformEventModifiers(event.modifiers); 437 m_modifiers = toPlatformEventModifiers(event.modifiers);
439 m_timestamp = event.timeStampSeconds; 438 m_timestamp = event.timeStampSeconds;
440 m_causesScrollingIfUncanceled = event.causesScrollingIfUncanceled; 439 m_causesScrollingIfUncanceled = event.causesScrollingIfUncanceled;
441 440
442 for (unsigned i = 0; i < event.touchesLength; ++i) 441 for (unsigned i = 0; i < event.touchesLength; ++i)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 modifiers = getWebInputModifiers(event); 752 modifiers = getWebInputModifiers(event);
754 753
755 globalX = event.screenX(); 754 globalX = event.screenX();
756 globalY = event.screenY(); 755 globalY = event.screenY();
757 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject); 756 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject);
758 x = localPoint.x(); 757 x = localPoint.x();
759 y = localPoint.y(); 758 y = localPoint.y();
760 } 759 }
761 760
762 } // namespace blink 761 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/PlatformTouchPoint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698