Bug 1016805 - fix AsyncTransactionTracker handling r=nical
☠☠ backed out by 8ee52188963c ☠ ☠
authorSotaro Ikeda <sikeda@mozilla.com>
Wed, 04 Jun 2014 07:49:14 -0700
changeset 206942 d37aa03d00fb837dad340f62fb99ecb1886b27c0
parent 206941 51b269a9c5c9ada5291547ce405457ee23b3a87e
child 206943 2184d492b3746c26b9d4c3ccd7603ce90cd2226c
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1016805
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1016805 - fix AsyncTransactionTracker handling r=nical
gfx/layers/client/ImageClient.cpp
gfx/layers/ipc/ImageBridgeChild.cpp
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -78,18 +78,18 @@ ImageClient::RemoveTexture(TextureClient
 
 void
 ImageClient::RemoveTextureWithTracker(TextureClient* aTexture,
                                       AsyncTransactionTracker* aAsyncTransactionTracker)
 {
 #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.
       request = new RemoveTextureFromCompositableTracker(this);
     }
     // Hold TextureClient until the transaction complete to postpone
     // the TextureClient recycle.
     request->SetTextureClient(aTexture);
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -394,24 +394,24 @@ void ImageBridgeChild::DispatchImageClie
   sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
     FROM_HERE,
     NewRunnableFunction<
       void (*)(ImageClient*, ImageContainer*),
       ImageClient*,
       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();
 }
 
 //static
 void ImageBridgeChild::FlushAllImages(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront)
 {
   if (!IsCreated()) {
@@ -420,23 +420,27 @@ void ImageBridgeChild::FlushAllImages(Im
   MOZ_ASSERT(aClient);
   MOZ_ASSERT(!sImageBridgeChildSingleton->mShuttingDown);
   MOZ_ASSERT(!InImageBridgeChildThread());
   if (InImageBridgeChildThread()) {
     NS_ERROR("ImageBridgeChild::FlushAllImages() is called on ImageBridge thread.");
      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
 ImageBridgeChild::BeginTransaction()
 {
   MOZ_ASSERT(!mShuttingDown);
   MOZ_ASSERT(mTxn->Finished(), "uncommitted txn?");
   mTxn->Begin();