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

Unified Diff: Source/core/dom/Touch.cpp

Issue 750013004: Added experimental tilt and tiltDirection to the Touch interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make Touch.tilt available behind the enable-experimental-web-platform-features flag Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Touch.cpp
diff --git a/Source/core/dom/Touch.cpp b/Source/core/dom/Touch.cpp
index edc0406c39e77c7e46631a1d4e34714ab71f0bd4..8299bce19019c24b71afc234741230a2c3bcb7ac 100644
--- a/Source/core/dom/Touch.cpp
+++ b/Source/core/dom/Touch.cpp
@@ -44,7 +44,7 @@ static FloatPoint contentsOffset(LocalFrame* frame)
return FloatPoint(frameView->scrollPosition()).scaledBy(scale);
}
-Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float force)
+Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float tilt, float force)
: m_target(target)
, m_identifier(identifier)
, m_clientPos(pagePos - contentsOffset(frame))
@@ -52,13 +52,14 @@ Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const
, m_pagePos(pagePos)
, m_radius(radius)
, m_rotationAngle(rotationAngle)
+ , m_tilt(tilt)
, m_force(force)
{
float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f;
m_absoluteLocation = roundedLayoutPoint(pagePos.scaledBy(scaleFactor));
}
-Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientPos, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float force, LayoutPoint absoluteLocation)
+Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientPos, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float tilt, float force, LayoutPoint absoluteLocation)
: m_target(target)
, m_identifier(identifier)
, m_clientPos(clientPos)
@@ -66,6 +67,7 @@ Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientP
, m_pagePos(pagePos)
, m_radius(radius)
, m_rotationAngle(rotationAngle)
+ , m_tilt(tilt)
, m_force(force)
, m_absoluteLocation(absoluteLocation)
{
@@ -73,7 +75,7 @@ Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientP
PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget) const
{
- return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation));
+ return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_tilt, m_force, m_absoluteLocation));
}
void Touch::trace(Visitor* visitor)

Powered by Google App Engine
This is Rietveld 408576698