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 341026 270900fec93245a4c8e93df3e74be837735766d7
parent 341025 330ab4695793c499110152a6582afca8e87ae46c
child 341027 595bbe23999f3d935c17fe77e50313ff1bb3c149
push id31323
push usercbook@mozilla.com
push dateTue, 07 Feb 2017 13:07:48 +0000
treeherdermozilla-central@b57c0a563ecd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1305889
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;