mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 886219 - Make sure we release ImageBridge compositables and textures from the ImageBridge thread. r=nical
This commit is contained in:
parent
ae90722e6c
commit
126b90d8b4
@ -381,6 +381,20 @@ void ImageBridgeChild::DispatchReleaseImageClient(ImageClient* aClient)
|
||||
NewRunnableFunction(&ReleaseImageClientNow, aClient));
|
||||
}
|
||||
|
||||
static void ReleaseTextureClientNow(TextureClient* aClient)
|
||||
{
|
||||
MOZ_ASSERT(InImageBridgeChildThread());
|
||||
aClient->Release();
|
||||
}
|
||||
|
||||
// static
|
||||
void ImageBridgeChild::DispatchReleaseTextureClient(TextureClient* aClient)
|
||||
{
|
||||
sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
|
||||
FROM_HERE,
|
||||
NewRunnableFunction(&ReleaseTextureClientNow, aClient));
|
||||
}
|
||||
|
||||
static void UpdateImageClientNow(ImageClient* aClient, ImageContainer* aContainer)
|
||||
{
|
||||
MOZ_ASSERT(aClient);
|
||||
|
@ -237,6 +237,7 @@ public:
|
||||
TemporaryRef<ImageClient> CreateImageClientNow(CompositableType aType);
|
||||
|
||||
static void DispatchReleaseImageClient(ImageClient* aClient);
|
||||
static void DispatchReleaseTextureClient(TextureClient* aClient);
|
||||
static void DispatchImageClientUpdate(ImageClient* aClient, ImageContainer* aContainer);
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
|
||||
#include "mozilla/layers/TextureClient.h" // for BufferTextureClient, etc
|
||||
#include "mozilla/layers/YCbCrImageDataSerializer.h"
|
||||
#include "mozilla/layers/ImageBridgeChild.h" // for ImageBridgeChild
|
||||
#include "mozilla/mozalloc.h" // for operator delete
|
||||
#include "nsISupportsImpl.h" // for Image::AddRef
|
||||
|
||||
@ -35,6 +36,12 @@ SharedPlanarYCbCrImage::SharedPlanarYCbCrImage(ImageClient* aCompositable)
|
||||
|
||||
SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
|
||||
MOZ_COUNT_DTOR(SharedPlanarYCbCrImage);
|
||||
|
||||
if (mCompositable->GetAsyncID() != 0 &&
|
||||
!InImageBridgeChildThread()) {
|
||||
ImageBridgeChild::DispatchReleaseTextureClient(mTextureClient.forget().drop());
|
||||
ImageBridgeChild::DispatchReleaseImageClient(mCompositable.forget().drop());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/layers/ImageClient.h" // for ImageClient
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
|
||||
#include "mozilla/layers/TextureClient.h" // for BufferTextureClient, etc
|
||||
#include "mozilla/layers/ImageBridgeChild.h" // for ImageBridgeChild
|
||||
#include "mozilla/mozalloc.h" // for operator delete, etc
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "nsDebug.h" // for NS_WARNING, NS_ASSERTION
|
||||
@ -183,6 +184,12 @@ SharedRGBImage::SharedRGBImage(ImageClient* aCompositable)
|
||||
SharedRGBImage::~SharedRGBImage()
|
||||
{
|
||||
MOZ_COUNT_DTOR(SharedRGBImage);
|
||||
|
||||
if (mCompositable->GetAsyncID() != 0 &&
|
||||
!InImageBridgeChildThread()) {
|
||||
ImageBridgeChild::DispatchReleaseTextureClient(mTextureClient.forget().drop());
|
||||
ImageBridgeChild::DispatchReleaseImageClient(mCompositable.forget().drop());
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user