Skip to content

Commit

Permalink
Bug 1411630 - make mozilla::gfx::VRHMDSensorState to be trivial typed…
Browse files Browse the repository at this point in the history
…. r=kip

MozReview-Commit-ID: 7BniyasLIQD
  • Loading branch information
abpostelnicu committed Oct 30, 2017
1 parent 2c45a6f commit 8d3a2c1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions dom/vr/VRServiceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ VRMockDisplay::VRMockDisplay(const nsCString& aID, uint32_t aDeviceID)
: mDeviceID(aDeviceID)
, mTimestamp(TimeStamp::Now())
{
memset(&mDisplayInfo, 0, sizeof(mDisplayInfo));
mDisplayInfo.mDisplayName = aID;
mDisplayInfo.mType = VRDeviceType::Puppet;
mDisplayInfo.mIsConnected = true;
Expand Down
2 changes: 2 additions & 0 deletions gfx/vr/VRDisplayHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ VRDisplayHost::VRDisplayHost(VRDeviceType aType)
: mFrameStarted(false)
{
MOZ_COUNT_CTOR(VRDisplayHost);
memset(&mDisplayInfo, 0, sizeof(VRDisplayInfo));
memset(&mLastUpdateDisplayInfo, 0, sizeof(VRDisplayInfo));
mDisplayInfo.mType = aType;
mDisplayInfo.mDisplayID = VRSystemManager::AllocateDisplayID();
mDisplayInfo.mPresentingGroups = 0;
Expand Down
4 changes: 0 additions & 4 deletions gfx/vr/gfxVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ struct VRFieldOfView {
};

struct VRHMDSensorState {
VRHMDSensorState()
{
Clear();
}
int64_t inputFrameID;
double timestamp;
VRDisplayCapabilityFlags flags;
Expand Down
2 changes: 1 addition & 1 deletion gfx/vr/gfxVROSVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ VRDisplayOSVR::GetSensorState()
//this usually goes into app's mainloop
osvr_ClientUpdate(*m_ctx);

VRHMDSensorState result;
VRHMDSensorState result{};
OSVR_TimeValue timestamp;

OSVR_OrientationState orientation;
Expand Down
8 changes: 4 additions & 4 deletions gfx/vr/gfxVROculus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ VRDisplayOculus::ZeroSensor()
VRHMDSensorState
VRDisplayOculus::GetSensorState()
{
VRHMDSensorState result;
VRHMDSensorState result{};
if (mSession->IsTrackingReady()) {
double predictedFrameTime = 0.0f;
if (gfxPrefs::VRPosePredictionEnabled()) {
Expand All @@ -882,7 +882,7 @@ VRDisplayOculus::GetSensorState()
VRHMDSensorState
VRDisplayOculus::GetSensorState(double absTime)
{
VRHMDSensorState result;
VRHMDSensorState result{};

ovrTrackingState state = ovr_GetTrackingState(mSession->Get(), absTime, true);
ovrPoseStatef& pose(state.HeadPose);
Expand All @@ -896,7 +896,7 @@ VRDisplayOculus::GetSensorState(double absTime)
result.orientation[1] = pose.ThePose.Orientation.y;
result.orientation[2] = pose.ThePose.Orientation.z;
result.orientation[3] = pose.ThePose.Orientation.w;

result.angularVelocity[0] = pose.AngularVelocity.x;
result.angularVelocity[1] = pose.AngularVelocity.y;
result.angularVelocity[2] = pose.AngularVelocity.z;
Expand All @@ -914,7 +914,7 @@ VRDisplayOculus::GetSensorState(double absTime)
result.position[0] = pose.ThePose.Position.x;
result.position[1] = pose.ThePose.Position.y;
result.position[2] = pose.ThePose.Position.z;

result.linearVelocity[0] = pose.LinearVelocity.x;
result.linearVelocity[1] = pose.LinearVelocity.y;
result.linearVelocity[2] = pose.LinearVelocity.z;
Expand Down
2 changes: 1 addition & 1 deletion gfx/vr/gfxVROpenVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ VRDisplayOpenVR::GetSensorState()
// Note: We *must* call WaitGetPoses in order for any rendering to happen at all.
mVRCompositor->WaitGetPoses(nullptr, 0, poses, posesSize);

VRHMDSensorState result;
VRHMDSensorState result{};

::vr::Compositor_FrameTiming timing;
timing.m_nSize = sizeof(::vr::Compositor_FrameTiming);
Expand Down
1 change: 1 addition & 0 deletions gfx/vr/gfxVRPuppet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static const uint32_t kNumPuppetHaptcs = 1;
VRDisplayPuppet::VRDisplayPuppet()
: VRDisplayHost(VRDeviceType::Puppet)
, mIsPresenting(false)
, mSensorState{}
{
MOZ_COUNT_CTOR_INHERITED(VRDisplayPuppet, VRDisplayHost);

Expand Down

0 comments on commit 8d3a2c1

Please sign in to comment.