mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
parent
f75592fd13
commit
9b1124ccbd
99 changed files with 6 additions and 15647 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue