Bug 1016805 - fix AsyncTransactionTracker handling r=nical

This commit is contained in:
Sotaro Ikeda 2014-06-04 07:49:14 -07:00
Родитель 740d4df4d0
Коммит 43b3882d48
2 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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