Bug 1305889 - Part 1: Move GamepadHand API to VRControllerHost; r?kip draft
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 06 Feb 2017 16:07:20 +0800
changeset 479191 4912e4f270243438929af7eb78faef215425d22e
parent 479117 6c998914bad21a65c7fe2ee7e8c1c7f5269c750d
child 479192 875cb2018c1a245206316a320563fbc811c72e02
child 479239 61d1b580a647979bc704b68df8d26f72acbd0804
push id44178
push userbmo:dmu@mozilla.com
push dateMon, 06 Feb 2017 08:21:05 +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;