Remove VR hardware support.

This resolves #881
This commit is contained in:
wolfbeast 2018-11-26 16:41:20 +01:00 committed by Roy Tam
commit 9b1124ccbd
99 changed files with 6 additions and 15647 deletions

View file

@ -47,7 +47,6 @@
#include "nsSVGEffects.h"
#include "prenv.h"
#include "ScopedGLHelpers.h"
#include "VRManagerChild.h"
#include "mozilla/layers/TextureClientSharedSurface.h"
// Local
@ -2239,84 +2238,6 @@ WebGLContext::GetUnpackSize(bool isFunc3D, uint32_t width, uint32_t height,
return totalBytes;
}
already_AddRefed<layers::SharedSurfaceTextureClient>
WebGLContext::GetVRFrame()
{
if (!mLayerIsMirror) {
/**
* Do not allow VR frame submission until a mirroring canvas layer has
* been returned by GetCanvasLayer
*/
return nullptr;
}
VRManagerChild* vrmc = VRManagerChild::Get();
if (!vrmc) {
return nullptr;
}
/**
* Swap buffers as though composition has occurred.
* We will then share the resulting front buffer to be submitted to the VR
* compositor.
*/
BeginComposition();
EndComposition();
gl::GLScreenBuffer* screen = gl->Screen();
if (!screen) {
return nullptr;
}
RefPtr<SharedSurfaceTextureClient> sharedSurface = screen->Front();
if (!sharedSurface) {
return nullptr;
}
if (sharedSurface && sharedSurface->GetAllocator() != vrmc) {
RefPtr<SharedSurfaceTextureClient> dest =
screen->Factory()->NewTexClient(sharedSurface->GetSize());
if (!dest) {
return nullptr;
}
gl::SharedSurface* destSurf = dest->Surf();
destSurf->ProducerAcquire();
SharedSurface::ProdCopy(sharedSurface->Surf(), dest->Surf(),
screen->Factory());
destSurf->ProducerRelease();
return dest.forget();
}
return sharedSurface.forget();
}
bool
WebGLContext::StartVRPresentation()
{
VRManagerChild* vrmc = VRManagerChild::Get();
if (!vrmc) {
return false;
}
gl::GLScreenBuffer* screen = gl->Screen();
if (!screen) {
return false;
}
gl::SurfaceCaps caps = screen->mCaps;
UniquePtr<gl::SurfaceFactory> factory =
gl::GLScreenBuffer::CreateFactory(gl,
caps,
vrmc,
vrmc->GetBackendType(),
TextureFlags::ORIGIN_BOTTOM_LEFT);
if (factory) {
screen->Morph(Move(factory));
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
static inline size_t