Bug 1608500 - Set SurfaceTexture factory into the VR GLScreenBuffer. r=jgilbert

The VR ScreenBuffer is created with the default SurfaceFactory_Basic. We need to morph the screen to use the correct SurfaceTexture factory.

Differential Revision: https://phabricator.services.mozilla.com/D60007

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Imanol Fernandez 2020-01-15 21:18:00 +00:00
Родитель 45330c2c4e
Коммит acf609f3d9
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1698,6 +1698,15 @@ RefPtr<layers::SharedSurfaceTextureClient> WebGLContext::GetVRFrame() {
if (!vrScreen) {
auto caps = gl->Screen()->mCaps;
vrScreen = gl::GLScreenBuffer::Create(gl, gfx::IntSize(1, 1), caps);
RefPtr<layers::ImageBridgeChild> imageBridge =
layers::ImageBridgeChild::GetSingleton();
if (imageBridge) {
layers::TextureFlags flags = layers::TextureFlags::ORIGIN_BOTTOM_LEFT;
UniquePtr<gl::SurfaceFactory> factory =
gl::GLScreenBuffer::CreateFactory(gl, caps, imageBridge.get(),
flags);
vrScreen->Morph(std::move(factory));
}
}
MOZ_ASSERT(vrScreen);
@ -1807,7 +1816,8 @@ bool ClientWebGLContext::IsXRCompatible() const {
return options.xrCompatible;
}
already_AddRefed<dom::Promise> ClientWebGLContext::MakeXRCompatible(ErrorResult& aRv) {
already_AddRefed<dom::Promise> ClientWebGLContext::MakeXRCompatible(
ErrorResult& aRv) {
const FuncScope funcScope(*this, "MakeXRCompatible");
nsCOMPtr<nsIGlobalObject> global;
// TODO: Bug 1596921