Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 15cf22a

Browse files
daoshengmubluemarvin
authored andcommitted
Clean up unused WebVR Foveated-Rendering code. (fixes #1275) (#1304)
1 parent 1ed4033 commit 15cf22a

File tree

8 files changed

+13
-20
lines changed

8 files changed

+13
-20
lines changed

app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,7 @@ public void updateEnvironment() {
10851085
@Override
10861086
public void updateFoveatedLevel() {
10871087
final int appLevel = SettingsStore.getInstance(this).getFoveatedLevelApp();
1088-
final int webVRLevel = SettingsStore.getInstance(this).getFoveatedLevelWebVR();
1089-
queueRunnable(() -> updateFoveatedLevelNative(appLevel, webVRLevel));
1088+
queueRunnable(() -> updateFoveatedLevelNative(appLevel));
10901089
}
10911090

10921091
@Override
@@ -1158,7 +1157,7 @@ public void setCylinderDensity(final float aDensity) {
11581157
private native void setCylinderDensityNative(float aDensity);
11591158
private native void setCPULevelNative(@CPULevelFlags int aCPULevel);
11601159
private native void setIsServo(boolean aIsServo);
1161-
private native void updateFoveatedLevelNative(int appLevel, int webVRLevel);
1160+
private native void updateFoveatedLevelNative(int appLevel);
11621161

11631162
@IntDef(value = { CPU_LEVEL_NORMAL, CPU_LEVEL_HIGH})
11641163
private @interface CPULevelFlags {}

app/src/main/cpp/BrowserWorld.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,9 @@ BrowserWorld::UpdateEnvironment() {
750750
}
751751

752752
void
753-
BrowserWorld::UpdateFoveatedLevel(const int aAppLevel, const int aWebVRLevel) {
753+
BrowserWorld::UpdateFoveatedLevel(const int aAppLevel) {
754754
ASSERT_ON_RENDER_THREAD();
755-
m.device->SetFoveatedLevel(aAppLevel, aWebVRLevel);
755+
m.device->SetFoveatedLevel(aAppLevel);
756756
}
757757

758758
void
@@ -1365,8 +1365,8 @@ JNI_METHOD(void, updateEnvironmentNative)
13651365
}
13661366

13671367
JNI_METHOD(void, updateFoveatedLevelNative)
1368-
(JNIEnv*, jobject, jint aAppLevel, jint aWebVRLevel) {
1369-
crow::BrowserWorld::Instance().UpdateFoveatedLevel(aAppLevel, aWebVRLevel);
1368+
(JNIEnv*, jobject, jint aAppLevel) {
1369+
crow::BrowserWorld::Instance().UpdateFoveatedLevel(aAppLevel);
13701370
}
13711371

13721372
JNI_METHOD(void, updatePointerColorNative)

app/src/main/cpp/BrowserWorld.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BrowserWorld {
4040
void Draw();
4141
void SetTemporaryFilePath(const std::string& aPath);
4242
void UpdateEnvironment();
43-
void UpdateFoveatedLevel(const int aAppLevel, const int aWebVRLevel);
43+
void UpdateFoveatedLevel(const int aAppLevel);
4444
void UpdatePointerColor();
4545
void SetSurfaceTexture(const std::string& aName, jobject& aSurface);
4646
void AddWidget(int32_t aHandle, const WidgetPlacementPtr& placement);

app/src/main/cpp/DeviceDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DeviceDelegate {
5858
virtual void SetClearColor(const vrb::Color& aColor) = 0;
5959
virtual void SetClipPlanes(const float aNear, const float aFar) = 0;
6060
virtual void SetControllerDelegate(ControllerDelegatePtr& aController) = 0;
61-
virtual void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {};
61+
virtual void SetFoveatedLevel(const int32_t aAppLevel) {};
6262
virtual void ReleaseControllerDelegate() = 0;
6363
virtual int32_t GetControllerModelCount() const = 0;
6464
virtual const std::string GetControllerModelName(const int32_t aModelIndex) const = 0;

app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ struct DeviceDelegateOculusVR::State {
616616
uint32_t renderWidth = 0;
617617
uint32_t renderHeight = 0;
618618
int32_t standaloneFoveatedLevel = 0;
619-
int32_t immersiveFoveatedLevel = 0;
620619
vrb::Color clearColor;
621620
float near = 0.1f;
622621
float far = 100.f;
@@ -714,11 +713,7 @@ struct DeviceDelegateOculusVR::State {
714713
if (!ovr) {
715714
return;
716715
}
717-
if (renderMode == device::RenderMode::StandAlone) {
718-
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, standaloneFoveatedLevel);
719-
} else {
720-
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, immersiveFoveatedLevel);
721-
}
716+
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, standaloneFoveatedLevel);
722717
}
723718

724719
void UpdateClockLevels() {
@@ -1175,9 +1170,8 @@ DeviceDelegateOculusVR::ReleaseControllerDelegate() {
11751170
}
11761171

11771172
void
1178-
DeviceDelegateOculusVR::SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {
1173+
DeviceDelegateOculusVR::SetFoveatedLevel(const int32_t aAppLevel) {
11791174
m.standaloneFoveatedLevel = aAppLevel;
1180-
m.immersiveFoveatedLevel = aWebVRLevel;
11811175
m.UpdateFoveatedLevel();
11821176
}
11831177

app/src/oculusvr/cpp/DeviceDelegateOculusVR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DeviceDelegateOculusVR : public DeviceDelegate {
3737
void SetClipPlanes(const float aNear, const float aFar) override;
3838
void SetControllerDelegate(ControllerDelegatePtr& aController) override;
3939
void ReleaseControllerDelegate() override;
40-
void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) override;
40+
void SetFoveatedLevel(const int32_t aAppLevel) override;
4141
int32_t GetControllerModelCount() const override;
4242
const std::string GetControllerModelName(const int32_t aModelIndex) const override;
4343
void SetCPULevel(const device::CPULevel aLevel) override;

app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ DeviceDelegateWaveVR::SetClipPlanes(const float aNear, const float aFar) {
469469
}
470470

471471
void
472-
DeviceDelegateWaveVR::SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {
472+
DeviceDelegateWaveVR::SetFoveatedLevel(const int32_t aAppLevel) {
473473
m.standaloneFoveatedLevel = aAppLevel;
474474
}
475475

app/src/wavevr/cpp/DeviceDelegateWaveVR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DeviceDelegateWaveVR : public DeviceDelegate {
2626
void SetReorientTransform(const vrb::Matrix& aMatrix) override;
2727
void SetClearColor(const vrb::Color& aColor) override;
2828
void SetClipPlanes(const float aNear, const float aFar) override;
29-
void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) override;
29+
void SetFoveatedLevel(const int32_t aAppLevel) override;
3030
void SetControllerDelegate(ControllerDelegatePtr& aController) override;
3131
void ReleaseControllerDelegate() override;
3232
int32_t GetControllerModelCount() const override;

0 commit comments

Comments
 (0)