Bug 1016805 - fix AsyncTransactionTracker handling r=nical

This commit is contained in:
Sotaro Ikeda 2014-06-04 07:49:14 -07:00
parent 0a99c4b213
commit 92b1a2feb0
2 changed files with 12 additions and 8 deletions

View File

@ -83,8 +83,8 @@ ImageClient::RemoveTextureWithTracker(TextureClient* aTexture,
#ifdef MOZ_WIDGET_GONK
// AsyncTransactionTracker is supported only on ImageBridge.
// Use AsyncTransactionTracker only when TextureClient is recyeled.
if (GetForwarder()->IsImageBridgeChild() &&
aTexture->HasRecycleCallback()) {
if (aAsyncTransactionTracker ||
(GetForwarder()->IsImageBridgeChild() && aTexture->HasRecycleCallback())) {
RefPtr<AsyncTransactionTracker> request = aAsyncTransactionTracker;
if (!request) {
// Create AsyncTransactionTracker if it is not provided as argument.

View File

@ -399,14 +399,14 @@ void ImageBridgeChild::DispatchImageClientUpdate(ImageClient* aClient,
nsRefPtr<ImageContainer> >(&UpdateImageClientNow, aClient, aContainer));
}
static void FlushAllImagesSync(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront, AsyncTransactionTracker* aStatus)
static void FlushAllImagesSync(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront, AsyncTransactionTracker* aTracker)
{
MOZ_ASSERT(aClient);
sImageBridgeChildSingleton->BeginTransaction();
if (aContainer && !aExceptFront) {
aContainer->ClearCurrentImage();
}
aClient->FlushAllImages(aExceptFront, aStatus);
aClient->FlushAllImages(aExceptFront, aTracker);
aClient->OnTransaction();
sImageBridgeChildSingleton->EndTransaction();
}
@ -425,13 +425,17 @@ void ImageBridgeChild::FlushAllImages(ImageClient* aClient, ImageContainer* aCon
return;
}
RefPtr<AsyncTransactionTracker> status = aClient->PrepareFlushAllImages();
RefPtr<AsyncTransactionTracker> tracker;
#ifdef MOZ_WIDGET_GONK
tracker = aClient->PrepareFlushAllImages();
#endif
sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
FROM_HERE,
NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, status));
NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, tracker));
status->WaitComplete();
if (tracker) {
tracker->WaitComplete();
}
}
void