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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 26 matching lines...) Expand all
37 { 37 {
38 if (!frame) 38 if (!frame)
39 return FloatPoint(); 39 return FloatPoint();
40 FrameView* frameView = frame->view(); 40 FrameView* frameView = frame->view();
41 if (!frameView) 41 if (!frameView)
42 return FloatPoint(); 42 return FloatPoint();
43 float scale = 1.0f / frame->pageZoomFactor(); 43 float scale = 1.0f / frame->pageZoomFactor();
44 return FloatPoint(frameView->scrollPosition()).scaledBy(scale); 44 return FloatPoint(frameView->scrollPosition()).scaledBy(scale);
45 } 45 }
46 46
47 Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float force) 47 Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float tilt, float force)
48 : m_target(target) 48 : m_target(target)
49 , m_identifier(identifier) 49 , m_identifier(identifier)
50 , m_clientPos(pagePos - contentsOffset(frame)) 50 , m_clientPos(pagePos - contentsOffset(frame))
51 , m_screenPos(screenPos) 51 , m_screenPos(screenPos)
52 , m_pagePos(pagePos) 52 , m_pagePos(pagePos)
53 , m_radius(radius) 53 , m_radius(radius)
54 , m_rotationAngle(rotationAngle) 54 , m_rotationAngle(rotationAngle)
55 , m_tilt(tilt)
55 , m_force(force) 56 , m_force(force)
56 { 57 {
57 float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f; 58 float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f;
58 m_absoluteLocation = roundedLayoutPoint(pagePos.scaledBy(scaleFactor)); 59 m_absoluteLocation = roundedLayoutPoint(pagePos.scaledBy(scaleFactor));
59 } 60 }
60 61
61 Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientP os, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& rad ius, float rotationAngle, float force, LayoutPoint absoluteLocation) 62 Touch::Touch(EventTarget* target, unsigned identifier, const FloatPoint& clientP os, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& rad ius, float rotationAngle, float tilt, float force, LayoutPoint absoluteLocation)
62 : m_target(target) 63 : m_target(target)
63 , m_identifier(identifier) 64 , m_identifier(identifier)
64 , m_clientPos(clientPos) 65 , m_clientPos(clientPos)
65 , m_screenPos(screenPos) 66 , m_screenPos(screenPos)
66 , m_pagePos(pagePos) 67 , m_pagePos(pagePos)
67 , m_radius(radius) 68 , m_radius(radius)
68 , m_rotationAngle(rotationAngle) 69 , m_rotationAngle(rotationAngle)
70 , m_tilt(tilt)
69 , m_force(force) 71 , m_force(force)
70 , m_absoluteLocation(absoluteLocation) 72 , m_absoluteLocation(absoluteLocation)
71 { 73 {
72 } 74 }
73 75
74 PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget ) const 76 PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget ) const
75 { 77 {
76 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation)) ; 78 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_tilt, m_force, m_absoluteLo cation));
77 } 79 }
78 80
79 void Touch::trace(Visitor* visitor) 81 void Touch::trace(Visitor* visitor)
80 { 82 {
81 visitor->trace(m_target); 83 visitor->trace(m_target);
82 } 84 }
83 85
84 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698