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

Commit

Permalink
Clean up unused WebVR Foveated-Rendering code. (fixes #1275) (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
daoshengmu authored and bluemarvin committed Jun 11, 2019
1 parent 1ed4033 commit 15cf22a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,7 @@ public void updateEnvironment() {
@Override
public void updateFoveatedLevel() {
final int appLevel = SettingsStore.getInstance(this).getFoveatedLevelApp();
final int webVRLevel = SettingsStore.getInstance(this).getFoveatedLevelWebVR();
queueRunnable(() -> updateFoveatedLevelNative(appLevel, webVRLevel));
queueRunnable(() -> updateFoveatedLevelNative(appLevel));
}

@Override
Expand Down Expand Up @@ -1158,7 +1157,7 @@ public void setCylinderDensity(final float aDensity) {
private native void setCylinderDensityNative(float aDensity);
private native void setCPULevelNative(@CPULevelFlags int aCPULevel);
private native void setIsServo(boolean aIsServo);
private native void updateFoveatedLevelNative(int appLevel, int webVRLevel);
private native void updateFoveatedLevelNative(int appLevel);

@IntDef(value = { CPU_LEVEL_NORMAL, CPU_LEVEL_HIGH})
private @interface CPULevelFlags {}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/BrowserWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ BrowserWorld::UpdateEnvironment() {
}

void
BrowserWorld::UpdateFoveatedLevel(const int aAppLevel, const int aWebVRLevel) {
BrowserWorld::UpdateFoveatedLevel(const int aAppLevel) {
ASSERT_ON_RENDER_THREAD();
m.device->SetFoveatedLevel(aAppLevel, aWebVRLevel);
m.device->SetFoveatedLevel(aAppLevel);
}

void
Expand Down Expand Up @@ -1365,8 +1365,8 @@ JNI_METHOD(void, updateEnvironmentNative)
}

JNI_METHOD(void, updateFoveatedLevelNative)
(JNIEnv*, jobject, jint aAppLevel, jint aWebVRLevel) {
crow::BrowserWorld::Instance().UpdateFoveatedLevel(aAppLevel, aWebVRLevel);
(JNIEnv*, jobject, jint aAppLevel) {
crow::BrowserWorld::Instance().UpdateFoveatedLevel(aAppLevel);
}

JNI_METHOD(void, updatePointerColorNative)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/BrowserWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BrowserWorld {
void Draw();
void SetTemporaryFilePath(const std::string& aPath);
void UpdateEnvironment();
void UpdateFoveatedLevel(const int aAppLevel, const int aWebVRLevel);
void UpdateFoveatedLevel(const int aAppLevel);
void UpdatePointerColor();
void SetSurfaceTexture(const std::string& aName, jobject& aSurface);
void AddWidget(int32_t aHandle, const WidgetPlacementPtr& placement);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/DeviceDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DeviceDelegate {
virtual void SetClearColor(const vrb::Color& aColor) = 0;
virtual void SetClipPlanes(const float aNear, const float aFar) = 0;
virtual void SetControllerDelegate(ControllerDelegatePtr& aController) = 0;
virtual void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {};
virtual void SetFoveatedLevel(const int32_t aAppLevel) {};
virtual void ReleaseControllerDelegate() = 0;
virtual int32_t GetControllerModelCount() const = 0;
virtual const std::string GetControllerModelName(const int32_t aModelIndex) const = 0;
Expand Down
10 changes: 2 additions & 8 deletions app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ struct DeviceDelegateOculusVR::State {
uint32_t renderWidth = 0;
uint32_t renderHeight = 0;
int32_t standaloneFoveatedLevel = 0;
int32_t immersiveFoveatedLevel = 0;
vrb::Color clearColor;
float near = 0.1f;
float far = 100.f;
Expand Down Expand Up @@ -714,11 +713,7 @@ struct DeviceDelegateOculusVR::State {
if (!ovr) {
return;
}
if (renderMode == device::RenderMode::StandAlone) {
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, standaloneFoveatedLevel);
} else {
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, immersiveFoveatedLevel);
}
vrapi_SetPropertyInt(&java, VRAPI_FOVEATION_LEVEL, standaloneFoveatedLevel);
}

void UpdateClockLevels() {
Expand Down Expand Up @@ -1175,9 +1170,8 @@ DeviceDelegateOculusVR::ReleaseControllerDelegate() {
}

void
DeviceDelegateOculusVR::SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {
DeviceDelegateOculusVR::SetFoveatedLevel(const int32_t aAppLevel) {
m.standaloneFoveatedLevel = aAppLevel;
m.immersiveFoveatedLevel = aWebVRLevel;
m.UpdateFoveatedLevel();
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/oculusvr/cpp/DeviceDelegateOculusVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DeviceDelegateOculusVR : public DeviceDelegate {
void SetClipPlanes(const float aNear, const float aFar) override;
void SetControllerDelegate(ControllerDelegatePtr& aController) override;
void ReleaseControllerDelegate() override;
void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) override;
void SetFoveatedLevel(const int32_t aAppLevel) override;
int32_t GetControllerModelCount() const override;
const std::string GetControllerModelName(const int32_t aModelIndex) const override;
void SetCPULevel(const device::CPULevel aLevel) override;
Expand Down
2 changes: 1 addition & 1 deletion app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ DeviceDelegateWaveVR::SetClipPlanes(const float aNear, const float aFar) {
}

void
DeviceDelegateWaveVR::SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) {
DeviceDelegateWaveVR::SetFoveatedLevel(const int32_t aAppLevel) {
m.standaloneFoveatedLevel = aAppLevel;
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/wavevr/cpp/DeviceDelegateWaveVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeviceDelegateWaveVR : public DeviceDelegate {
void SetReorientTransform(const vrb::Matrix& aMatrix) override;
void SetClearColor(const vrb::Color& aColor) override;
void SetClipPlanes(const float aNear, const float aFar) override;
void SetFoveatedLevel(const int32_t aAppLevel, const int32_t aWebVRLevel) override;
void SetFoveatedLevel(const int32_t aAppLevel) override;
void SetControllerDelegate(ControllerDelegatePtr& aController) override;
void ReleaseControllerDelegate() override;
int32_t GetControllerModelCount() const override;
Expand Down

0 comments on commit 15cf22a

Please sign in to comment.