Title: [106949] trunk/Source/WebKit2
Revision
106949
Author
[email protected]
Date
2012-02-07 08:18:30 -0800 (Tue, 07 Feb 2012)

Log Message

Encode radius, force and rotationAngle in WebPlatformTouchPoint.
https://bugs.webkit.org/show_bug.cgi?id=77986

Patch by Allan Sandfeld Jensen <[email protected]> on 2012-02-07
Reviewed by Kenneth Rohde Christiansen.

* Shared/WebEvent.h:
(WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
(WebPlatformTouchPoint):
(WebKit::WebPlatformTouchPoint::radius):
(WebKit::WebPlatformTouchPoint::rotationAngle):
(WebKit::WebPlatformTouchPoint::force):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
* Shared/WebPlatformTouchPoint.cpp:
(WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
(WebKit::WebPlatformTouchPoint::encode):
(WebKit::WebPlatformTouchPoint::decode):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (106948 => 106949)


--- trunk/Source/WebKit2/ChangeLog	2012-02-07 16:16:16 UTC (rev 106948)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-07 16:18:30 UTC (rev 106949)
@@ -1,3 +1,23 @@
+2012-02-07  Allan Sandfeld Jensen  <[email protected]>
+
+        Encode radius, force and rotationAngle in WebPlatformTouchPoint.
+        https://bugs.webkit.org/show_bug.cgi?id=77986
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * Shared/WebEvent.h:
+        (WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
+        (WebPlatformTouchPoint):
+        (WebKit::WebPlatformTouchPoint::radius):
+        (WebKit::WebPlatformTouchPoint::rotationAngle):
+        (WebKit::WebPlatformTouchPoint::force):
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
+        * Shared/WebPlatformTouchPoint.cpp:
+        (WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
+        (WebKit::WebPlatformTouchPoint::encode):
+        (WebKit::WebPlatformTouchPoint::decode):
+
 2012-02-07  Andras Becsi  <[email protected]>
 
         [Qt] [WK2] Fix the debug build after r106920

Modified: trunk/Source/WebKit2/Shared/WebEvent.h (106948 => 106949)


--- trunk/Source/WebKit2/Shared/WebEvent.h	2012-02-07 16:16:16 UTC (rev 106948)
+++ trunk/Source/WebKit2/Shared/WebEvent.h	2012-02-07 16:18:30 UTC (rev 106949)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -291,16 +292,21 @@
         TouchCancelled
     };
 
-    WebPlatformTouchPoint() { }
+    WebPlatformTouchPoint() : m_rotationAngle(0.0), m_force(0.0) { }
 
     WebPlatformTouchPoint(uint32_t id, TouchPointState, const WebCore::IntPoint& screenPosition, const WebCore::IntPoint& position);
 
+    WebPlatformTouchPoint(uint32_t id, TouchPointState, const WebCore::IntPoint& screenPosition, const WebCore::IntPoint& position, const WebCore::IntSize& radius, float rotationAngle = 0.0, float force = 0.0);
+    
     uint32_t id() const { return m_id; }
     TouchPointState state() const { return static_cast<TouchPointState>(m_state); }
 
     const WebCore::IntPoint& screenPosition() const { return m_screenPosition; }
     const WebCore::IntPoint& position() const { return m_position; }
-          
+    const WebCore::IntSize& radius() const { return m_radius; }
+    float rotationAngle() const { return m_rotationAngle; }
+    float force() const { return m_force; }
+
     void setState(TouchPointState state) { m_state = state; }
 
     void encode(CoreIPC::ArgumentEncoder*) const;
@@ -311,7 +317,9 @@
     uint32_t m_state;
     WebCore::IntPoint m_screenPosition;
     WebCore::IntPoint m_position;
-
+    WebCore::IntSize m_radius;
+    float m_rotationAngle;
+    float m_force;
 };
 
 // FIXME: Move this class to its own header file.

Modified: trunk/Source/WebKit2/Shared/WebEventConversion.cpp (106948 => 106949)


--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp	2012-02-07 16:16:16 UTC (rev 106948)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp	2012-02-07 16:18:30 UTC (rev 106949)
@@ -274,6 +274,10 @@
 
         m_screenPos = webTouchPoint.screenPosition();
         m_pos = webTouchPoint.position();
+        m_radiusX = webTouchPoint.radius().width();
+        m_radiusY = webTouchPoint.radius().height();
+        m_force = webTouchPoint.force();
+        m_rotationAngle = webTouchPoint.rotationAngle();
     }
 };
 

Modified: trunk/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp (106948 => 106949)


--- trunk/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp	2012-02-07 16:16:16 UTC (rev 106948)
+++ trunk/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp	2012-02-07 16:18:30 UTC (rev 106949)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -40,17 +41,30 @@
     , m_state(state)
     , m_screenPosition(screenPosition)
     , m_position(position)
+    , m_rotationAngle(0.0)
+    , m_force(0.0)
 {
 }
 
+WebPlatformTouchPoint::WebPlatformTouchPoint(unsigned id, TouchPointState state, const IntPoint& screenPosition, const IntPoint& position, const WebCore::IntSize& radius, float rotationAngle, float force)
+    : m_id(id)
+    , m_state(state)
+    , m_screenPosition(screenPosition)
+    , m_position(position)
+    , m_radius(radius)
+    , m_rotationAngle(rotationAngle)
+    , m_force(force)
+{
+}
+
 void WebPlatformTouchPoint::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
-    encoder->encode(CoreIPC::In(m_id, m_state, m_screenPosition, m_position));
+    encoder->encode(CoreIPC::In(m_id, m_state, m_screenPosition, m_position, m_radius, m_rotationAngle, m_force));
 }
 
 bool WebPlatformTouchPoint::decode(CoreIPC::ArgumentDecoder* decoder, WebPlatformTouchPoint& t)
 {
-    return decoder->decode(CoreIPC::Out(t.m_id, t.m_state, t.m_screenPosition, t.m_position));
+    return decoder->decode(CoreIPC::Out(t.m_id, t.m_state, t.m_screenPosition, t.m_position, t.m_radius, t.m_rotationAngle, t.m_force));
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to