Backed out 3 changesets (bug 1260611) for build failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Wed, 25 May 2016 15:20:24 -0700
changeset 333023 4f7c3a2567f88307b10e4b6fc9b0d4b180fe58a3
parent 333022 b91fad4c1ea76eeaeb54898761314fc079fa073d
child 333024 6d2e4eb24c2eabfe4f879b534b931be1058620b7
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1260611
milestone48.0a2
backs outb91fad4c1ea76eeaeb54898761314fc079fa073d
e5dc1c7fcb08356caa6f5dd7568e52463f1f0459
4a4cf532f07c9ae9c880f8c1920ef9211d48922a
Backed out 3 changesets (bug 1260611) for build failures a=backout Backed out changeset b91fad4c1ea7 (bug 1260611) Backed out changeset e5dc1c7fcb08 (bug 1260611) Backed out changeset 4a4cf532f07c (bug 1260611)
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/client/TextureClientRecycleAllocator.cpp
gfx/layers/composite/ImageHost.cpp
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/d3d11/CompositorD3D11.cpp
gfx/layers/d3d11/CompositorD3D11.h
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -910,17 +910,16 @@ TextureClient::TextureClient(TextureData
 , mActor(nullptr)
 , mData(aData)
 , mFlags(aFlags)
 , mOpenMode(OpenMode::OPEN_NONE)
 #ifdef DEBUG
 , mExpectedDtRefs(0)
 #endif
 , mIsLocked(false)
-, mInUse(false)
 , mAddedToCompositableClient(false)
 , mWorkaroundAnnoyingSharedSurfaceLifetimeIssues(false)
 , mWorkaroundAnnoyingSharedSurfaceOwnershipIssues(false)
 #ifdef GFX_DEBUG_TRACK_CLIENTS_IN_POOL
 , mPoolTracker(nullptr)
 #endif
 {
   mFlags |= mData->GetTextureFlags();
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -326,23 +326,16 @@ public:
   void Unlock();
 
   bool IsLocked() const { return mIsLocked; }
 
   bool CanExposeDrawTarget() const { return mData->SupportsMoz2D(); }
 
   bool CanExposeMappedData() const { return mData->CanExposeMappedData(); }
 
-  /* TextureClientRecycleAllocator tracking to decide if we need
-   * to check with the compositor before recycling.
-   * Should be superceeded (and removed) by bug 1252835.
-   */
-  void SetInUse(bool aInUse) { mInUse = aInUse; }
-  bool IsInUse() { return mInUse; }
-
   /**
    * Returns a DrawTarget to draw into the TextureClient.
    * This function should never be called when not on the main thread!
    *
    * This must never be called on a TextureClient that is not sucessfully locked.
    * When called several times within one Lock/Unlock pair, this method should
    * return the same DrawTarget.
    * The DrawTarget is automatically flushed by the TextureClient when the latter
@@ -639,17 +632,16 @@ protected:
   FenceHandle mAcquireFenceHandle;
   gl::GfxTextureWasteTracker mWasteTracker;
 
   OpenMode mOpenMode;
 #ifdef DEBUG
   uint32_t mExpectedDtRefs;
 #endif
   bool mIsLocked;
-  bool mInUse;
 
   bool mAddedToCompositableClient;
   bool mWorkaroundAnnoyingSharedSurfaceLifetimeIssues;
   bool mWorkaroundAnnoyingSharedSurfaceOwnershipIssues;
 
   RefPtr<TextureReadbackSink> mReadbackSink;
 
   friend class TextureChild;
--- a/gfx/layers/client/TextureClientRecycleAllocator.cpp
+++ b/gfx/layers/client/TextureClientRecycleAllocator.cpp
@@ -175,17 +175,16 @@ TextureClientRecycleAllocator::CreateOrR
     // Register TextureClient
     mInUseClients[textureHolder->GetTextureClient()] = textureHolder;
   }
   RefPtr<TextureClient> client(textureHolder->GetTextureClient());
 
   // Make sure the texture holds a reference to us, and ask it to call RecycleTextureClient when its
   // ref count drops to 1.
   client->SetRecycleAllocator(this);
-  client->SetInUse(true);
   return client.forget();
 }
 
 already_AddRefed<TextureClient>
 TextureClientRecycleAllocator::Allocate(gfx::SurfaceFormat aFormat,
                                         gfx::IntSize aSize,
                                         BackendSelector aSelector,
                                         TextureFlags aTextureFlags,
@@ -199,45 +198,19 @@ void
 TextureClientRecycleAllocator::ShrinkToMinimumSize()
 {
   MutexAutoLock lock(mLock);
   while (!mPooledClients.empty()) {
     mPooledClients.pop();
   }
 }
 
-class TextureClientWaitTask : public Runnable
-{
-public:
-  explicit TextureClientWaitTask(TextureClient* aClient)
-    : mTextureClient(aClient)
-  {}
-
-  NS_IMETHOD Run() override
-  {
-    mTextureClient->WaitForCompositorRecycle();
-    return NS_OK;
-  }
-
-private:
-  RefPtr<TextureClient> mTextureClient;
-};
-
 void
 TextureClientRecycleAllocator::RecycleTextureClient(TextureClient* aClient)
 {
-  if (aClient->IsInUse()) {
-    aClient->SetInUse(false);
-    // This adds another ref to aClient, and drops it after a round trip
-    // to the compositor. We should then get this callback a second time
-    // and can recycle properly.
-    RefPtr<Runnable> task = new TextureClientWaitTask(aClient);
-    mSurfaceAllocator->GetMessageLoop()->PostTask(task.forget());
-    return;
-  }
   // Clearing the recycle allocator drops a reference, so make sure we stay alive
   // for the duration of this function.
   RefPtr<TextureClientRecycleAllocator> kungFuDeathGrip(this);
   aClient->SetRecycleAllocator(nullptr);
 
   RefPtr<TextureClientHolder> textureHolder;
   {
     MutexAutoLock lock(mLock);
--- a/gfx/layers/composite/ImageHost.cpp
+++ b/gfx/layers/composite/ImageHost.cpp
@@ -326,21 +326,16 @@ ImageHost::Composite(LayerComposite* aLa
   }
 
   if (uint32_t(imageIndex) + 1 < mImages.Length()) {
     GetCompositor()->CompositeUntil(mImages[imageIndex + 1].mTimeStamp + TimeDuration::FromMilliseconds(BIAS_TIME_MS));
   }
 
   TimedImage* img = &mImages[imageIndex];
   img->mTextureHost->SetCompositor(GetCompositor());
-  // If this TextureHost will be recycled, then make sure we hold a reference to
-  // it until we're sure that the compositor has finished reading from it.
-  if (img->mTextureHost->GetFlags() & TextureFlags::RECYCLE) {
-    aLayer->GetLayerManager()->HoldTextureUntilNextComposite(img->mTextureHost);
-  }
   SetCurrentTextureHost(img->mTextureHost);
 
   {
     AutoLockCompositableHost autoLock(this);
     if (autoLock.Failed()) {
       NS_WARNING("failed to lock front buffer");
       return;
     }
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -387,19 +387,16 @@ LayerManagerComposite::EndTransaction(co
   // Set composition timestamp here because we need it in
   // ComputeEffectiveTransforms (so the correct video frame size is picked) and
   // also to compute invalid regions properly.
   mCompositor->SetCompositionTime(aTimeStamp);
 
   if (mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
     MOZ_ASSERT(!aTimeStamp.IsNull());
     UpdateAndRender();
-
-    mPreviousHeldTextureHosts.Clear();
-    mPreviousHeldTextureHosts.SwapElements(mCurrentHeldTextureHosts);
   } else {
     // Modified the layer tree.
     mGeometryChanged = true;
   }
 
   mCompositor->ClearTargetContext();
   mTarget = nullptr;
 
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -332,20 +332,16 @@ public:
 
   // Indicate that we need to composite even if nothing in our layers has
   // changed, so that the widget can draw something different in its window
   // overlay.
   void SetWindowOverlayChanged() { mWindowOverlayChanged = true; }
 
   void ForcePresent() { mCompositor->ForcePresent(); }
 
-  void HoldTextureUntilNextComposite(TextureHost* aTextureHost) {
-    mCurrentHeldTextureHosts.AppendElement(aTextureHost);
-  }
-
 private:
   /** Region we're clipping our current drawing to. */
   nsIntRegion mClippingRegion;
   gfx::IntRect mRenderBounds;
 
   /** Current root layer. */
   LayerComposite* RootLayer() const;
 
@@ -396,19 +392,16 @@ private:
   float mWarningLevel;
   mozilla::TimeStamp mWarnTime;
   bool mUnusedApzTransformWarning;
   RefPtr<Compositor> mCompositor;
   UniquePtr<LayerProperties> mClonedLayerTreeProperties;
 
   nsTArray<ImageCompositeNotification> mImageCompositeNotifications;
 
-  nsTArray<RefPtr<TextureHost>> mCurrentHeldTextureHosts;
-  nsTArray<RefPtr<TextureHost>> mPreviousHeldTextureHosts;
-
   /**
    * Context target, nullptr when drawing directly to our swap chain.
    */
   RefPtr<gfx::DrawTarget> mTarget;
   gfx::IntRect mTargetBounds;
 
   nsIntRegion mInvalidRegion;
 
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -1204,23 +1204,16 @@ CompositorD3D11::EndFrame()
   }
 
   LayoutDeviceIntSize oldSize = mSize;
   EnsureSize();
   if (mSize.width <= 0 || mSize.height <= 0) {
     return;
   }
 
-  RefPtr<ID3D11Query> query;
-  CD3D11_QUERY_DESC  desc(D3D11_QUERY_EVENT);
-  mDevice->CreateQuery(&desc, getter_AddRefs(query));
-  if (query) {
-    mContext->End(query);
-  }
-
   UINT presentInterval = 0;
 
   if (gfxWindowsPlatform::GetPlatform()->IsWARP()) {
     // When we're using WARP we cannot present immediately as it causes us
     // to tear when rendering. When not using WARP it appears the DWM takes
     // care of tearing for us.
     presentInterval = 1;
   }
@@ -1271,33 +1264,16 @@ CompositorD3D11::EndFrame()
       }
     }
     mDisableSequenceForNextFrame = false;
     if (mTarget) {
       PaintToTarget();
     }
   }
 
-  // Block until the previous frame's work has been completed.
-  if (mQuery) {
-    TimeStamp start = TimeStamp::Now();
-    BOOL result;
-    while (mContext->GetData(mQuery, &result, sizeof(BOOL), 0) != S_OK) {
-      if (mDevice->GetDeviceRemovedReason() != S_OK) {
-        break;
-      }
-      if ((TimeStamp::Now() - start) > TimeDuration::FromSeconds(2)) {
-        break;
-      }
-      Sleep(0);
-    }
-  }
-  // Store the query for this frame so we can flush it next time.
-  mQuery = query;
-
   mCurrentRT = nullptr;
 }
 
 void
 CompositorD3D11::PrepareViewport(const gfx::IntSize& aSize)
 {
   // This view matrix translates coordinates from 0..width and 0..height to
   // -1..1 on the X axis, and -1..1 on the Y axis (flips the Y coordinate)
--- a/gfx/layers/d3d11/CompositorD3D11.h
+++ b/gfx/layers/d3d11/CompositorD3D11.h
@@ -184,18 +184,16 @@ private:
                     RefPtr<ID3D11ShaderResourceView>* aOutView);
 
   RefPtr<ID3D11DeviceContext> mContext;
   RefPtr<ID3D11Device> mDevice;
   RefPtr<IDXGISwapChain> mSwapChain;
   RefPtr<CompositingRenderTargetD3D11> mDefaultRT;
   RefPtr<CompositingRenderTargetD3D11> mCurrentRT;
 
-  RefPtr<ID3D11Query> mQuery;
-
   DeviceAttachmentsD3D11* mAttachments;
 
   nsIWidget* mWidget;
 
   LayoutDeviceIntSize mSize;
 
   HWND mHwnd;