Bug 1305889 - Part 1: Move GamepadHand API to VRControllerHost; r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 06 Feb 2017 16:07:20 +0800
changeset 479885 270900fec93245a4c8e93df3e74be837735766d7
parent 479884 330ab4695793c499110152a6582afca8e87ae46c
child 479886 595bbe23999f3d935c17fe77e50313ff1bb3c149
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewerskip
bugs1305889
milestone54.0a1
Bug 1305889 - Part 1: Move GamepadHand API to VRControllerHost; r=kip MozReview-Commit-ID: 5Wi8p0hvgWf
gfx/vr/VRDisplayHost.cpp
gfx/vr/VRDisplayHost.h
--- a/gfx/vr/VRDisplayHost.cpp
+++ b/gfx/vr/VRDisplayHost.cpp
@@ -194,8 +194,20 @@ VRControllerHost::SetPose(const dom::Gam
 }
 
 const dom::GamepadPoseState&
 VRControllerHost::GetPose()
 {
   return mPose;
 }
 
+void
+VRControllerHost::SetHand(dom::GamepadHand aHand)
+{
+  mControllerInfo.mHand = aHand;
+}
+
+dom::GamepadHand
+VRControllerHost::GetHand()
+{
+  return mControllerInfo.mHand;
+}
+
--- a/gfx/vr/VRDisplayHost.h
+++ b/gfx/vr/VRDisplayHost.h
@@ -90,16 +90,18 @@ public:
 
   const VRControllerInfo& GetControllerInfo() const;
   void SetIndex(uint32_t aIndex);
   uint32_t GetIndex();
   void SetButtonPressed(uint64_t aBit);
   uint64_t GetButtonPressed();
   void SetPose(const dom::GamepadPoseState& aPose);
   const dom::GamepadPoseState& GetPose();
+  void SetHand(dom::GamepadHand aHand);
+  dom::GamepadHand GetHand();
 
 protected:
   explicit VRControllerHost(VRDeviceType aType);
   virtual ~VRControllerHost();
 
   VRControllerInfo mControllerInfo;
   // The controller index in VRControllerManager.
   uint32_t mIndex;