mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 595055 - Use the correct context when deleting textures, so we don't accidentally unset some state like the viewport. r=vlad a=b
This commit is contained in:
parent
cfe8913fec
commit
8ab2818e4f
@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
#include "prlink.h"
|
#include "prlink.h"
|
||||||
|
|
||||||
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
#include "gfxImageSurface.h"
|
#include "gfxImageSurface.h"
|
||||||
#include "GLContext.h"
|
#include "GLContext.h"
|
||||||
#include "GLContextProvider.h"
|
#include "GLContextProvider.h"
|
||||||
@ -436,12 +438,19 @@ GLContext::CreateTextureImage(const nsIntSize& aSize,
|
|||||||
|
|
||||||
BasicTextureImage::~BasicTextureImage()
|
BasicTextureImage::~BasicTextureImage()
|
||||||
{
|
{
|
||||||
nsRefPtr<GLContext> ctx = mGLContext->GetSharedContext();
|
GLContext *ctx = mGLContext;
|
||||||
if (!ctx) {
|
if (ctx->IsDestroyed() || !NS_IsMainThread()) {
|
||||||
ctx = mGLContext;
|
ctx = ctx->GetSharedContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have a context, then we need to delete the texture;
|
||||||
|
// if we don't have a context (either real or shared),
|
||||||
|
// then they went away when the contex was deleted, because it
|
||||||
|
// was the only one that had access to it.
|
||||||
|
if (ctx && !ctx->IsDestroyed()) {
|
||||||
|
mGLContext->MakeCurrent();
|
||||||
|
mGLContext->fDeleteTextures(1, &mTexture);
|
||||||
}
|
}
|
||||||
ctx->MakeCurrent();
|
|
||||||
ctx->fDeleteTextures(1, &mTexture);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxContext*
|
gfxContext*
|
||||||
|
@ -393,6 +393,11 @@ public:
|
|||||||
// the GL function pointers!
|
// the GL function pointers!
|
||||||
void THEBES_API MarkDestroyed();
|
void THEBES_API MarkDestroyed();
|
||||||
|
|
||||||
|
PRBool IsDestroyed() {
|
||||||
|
// MarkDestroyed will mark all these as null.
|
||||||
|
return fUseProgram == nsnull;
|
||||||
|
}
|
||||||
|
|
||||||
enum NativeDataType {
|
enum NativeDataType {
|
||||||
NativeGLContext,
|
NativeGLContext,
|
||||||
NativeImageSurface,
|
NativeImageSurface,
|
||||||
|
Loading…
Reference in New Issue
Block a user