mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 949816 - Move override-EGLSurface feature out of GLContext - r=jgilbert
This commit is contained in:
parent
62c75299c9
commit
277b7c507a
@ -2443,21 +2443,6 @@ public:
|
||||
bool IsOwningThreadCurrent();
|
||||
void DispatchToOwningThread(nsIRunnable *event);
|
||||
|
||||
/**
|
||||
* Only on EGL.
|
||||
*
|
||||
* If surf is non-null, this sets it to temporarily override this context's
|
||||
* primary surface. This makes this context current against this surface,
|
||||
* and subsequent MakeCurrent calls will continue using this surface as long
|
||||
* as this override is set.
|
||||
*
|
||||
* If surf is null, this removes any previously set override, and makes the
|
||||
* context current again against its primary surface.
|
||||
*/
|
||||
virtual void SetEGLSurfaceOverride(EGLSurface surf) {
|
||||
MOZ_CRASH("Must be called against a GLContextEGL.");
|
||||
}
|
||||
|
||||
static void PlatformStartup();
|
||||
|
||||
public:
|
||||
|
@ -409,7 +409,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void SetEGLSurfaceOverride(EGLSurface surf) MOZ_OVERRIDE {
|
||||
void SetEGLSurfaceOverride(EGLSurface surf) {
|
||||
if (Screen()) {
|
||||
/* Blit `draw` to `read` if we need to, before we potentially juggle
|
||||
* `read` around. If we don't, we might attach a different `read`,
|
||||
@ -894,6 +894,16 @@ GLContextProviderEGL::Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
GLContextEGL* DowncastGLContextEGL(GLContext* context)
|
||||
{
|
||||
return static_cast<GLContextEGL*>(context);
|
||||
}
|
||||
|
||||
void SetEGLSurfaceOverride(GLContextEGL* context, EGLSurface surf)
|
||||
{
|
||||
context->SetEGLSurfaceOverride(surf);
|
||||
}
|
||||
|
||||
} /* namespace gl */
|
||||
} /* namespace mozilla */
|
||||
|
||||
|
@ -12,6 +12,10 @@ using namespace mozilla::gfx;
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
class GLContextEGL;
|
||||
void SetEGLSurfaceOverride(GLContextEGL* context, EGLSurface surf);
|
||||
GLContextEGL* DowncastGLContextEGL(GLContext* context);
|
||||
|
||||
SurfaceFactory_ANGLEShareHandle*
|
||||
SurfaceFactory_ANGLEShareHandle::Create(GLContext* gl,
|
||||
ID3D10Device1* d3d,
|
||||
@ -45,7 +49,7 @@ SharedSurface_ANGLEShareHandle::~SharedSurface_ANGLEShareHandle()
|
||||
void
|
||||
SharedSurface_ANGLEShareHandle::LockProdImpl()
|
||||
{
|
||||
mGL->SetEGLSurfaceOverride(mPBuffer);
|
||||
SetEGLSurfaceOverride(DowncastGLContextEGL(mGL), mPBuffer);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user