зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1387920
- Drop all ImageContainers' ImageClients during disabling WebRender r=nical
This commit is contained in:
Родитель
5378a4e195
Коммит
99c13fbf3d
|
@ -135,6 +135,16 @@ ImageContainer::GetImageClient()
|
|||
return imageClient.forget();
|
||||
}
|
||||
|
||||
void
|
||||
ImageContainer::DropImageClient()
|
||||
{
|
||||
RecursiveMutexAutoLock mon(mRecursiveMutex);
|
||||
if (mImageClient) {
|
||||
mImageClient->ClearCachedResources();
|
||||
mImageClient = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ImageContainer::EnsureImageClient()
|
||||
{
|
||||
|
|
|
@ -618,6 +618,8 @@ public:
|
|||
*/
|
||||
static ProducerID AllocateProducerID();
|
||||
|
||||
void DropImageClient();
|
||||
|
||||
private:
|
||||
typedef mozilla::RecursiveMutex RecursiveMutex;
|
||||
|
||||
|
|
|
@ -726,7 +726,24 @@ MessageLoop * ImageBridgeChild::GetMessageLoop() const
|
|||
ImageBridgeChild::IdentifyCompositorTextureHost(const TextureFactoryIdentifier& aIdentifier)
|
||||
{
|
||||
if (RefPtr<ImageBridgeChild> child = GetSingleton()) {
|
||||
child->IdentifyTextureHost(aIdentifier);
|
||||
child->UpdateTextureFactoryIdentifier(aIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aIdentifier)
|
||||
{
|
||||
bool disablingWebRender = GetCompositorBackendType() == LayersBackend::LAYERS_WR &&
|
||||
aIdentifier.mParentBackend != LayersBackend::LAYERS_WR;
|
||||
IdentifyTextureHost(aIdentifier);
|
||||
if (disablingWebRender) {
|
||||
// ImageHost is incompatible between WebRender enabled and WebRender disabled.
|
||||
// Then drop all ImageContainers' ImageClients during disabling WebRender.
|
||||
MutexAutoLock lock(mContainerMapLock);
|
||||
for (auto iter = mImageContainers.Iter(); !iter.Done(); iter.Next()) {
|
||||
ImageContainer* container = iter.Data();
|
||||
container->DropImageClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -250,6 +250,8 @@ private:
|
|||
void ProxyAllocShmemNow(SynchronousTask* aTask, AllocShmemParams* aParams);
|
||||
void ProxyDeallocShmemNow(SynchronousTask* aTask, Shmem* aShmem, bool* aResult);
|
||||
|
||||
void UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aIdentifier);
|
||||
|
||||
public:
|
||||
// CompositableForwarder
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче