Backed out changeset be88a56c4856 (bug 1197534) for test_BufferingWait.html crashes CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 14 Sep 2015 14:43:52 -0700
changeset 295037 3f02dab20a515af485c055a070d9728ed559e5b4
parent 295036 21b8c95e507a158485a12eed3dc23e4ee8f4711d
child 295038 0577b78a0aae398d93d6cfeb1c096f8cff31d3c0
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1197534
milestone43.0a1
backs outbe88a56c48561612de43572a2e5ed03ebc98b9eb
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
Backed out changeset be88a56c4856 (bug 1197534) for test_BufferingWait.html crashes CLOSED TREE
gfx/layers/client/TextureClientRecycleAllocator.cpp
--- a/gfx/layers/client/TextureClientRecycleAllocator.cpp
+++ b/gfx/layers/client/TextureClientRecycleAllocator.cpp
@@ -48,34 +48,16 @@ TextureClientRecycleAllocator::~TextureC
 }
 
 void
 TextureClientRecycleAllocator::SetMaxPoolSize(uint32_t aMax)
 {
   mMaxPooledSize = aMax;
 }
 
-class TextureClientRecycleTask : public Task
-{
-public:
-  explicit TextureClientRecycleTask(TextureClient* aClient, TextureFlags aFlags)
-    : mTextureClient(aClient)
-    , mFlags(aFlags)
-  {}
-
-  virtual void Run() override
-  {
-    mTextureClient->RecycleTexture(mFlags);
-  }
-
-private:
-  mozilla::RefPtr<TextureClient> mTextureClient;
-  TextureFlags mFlags;
-};
-
 already_AddRefed<TextureClient>
 TextureClientRecycleAllocator::CreateOrRecycle(gfx::SurfaceFormat aFormat,
                                                gfx::IntSize aSize,
                                                BackendSelector aSelector,
                                                TextureFlags aTextureFlags,
                                                TextureAllocationFlags aAllocFlags)
 {
   // TextureAllocationFlags is actually used only by ContentClient.
@@ -87,28 +69,27 @@ TextureClientRecycleAllocator::CreateOrR
 
   RefPtr<TextureClientHolder> textureHolder;
 
   {
     MutexAutoLock lock(mLock);
     if (!mPooledClients.empty()) {
       textureHolder = mPooledClients.top();
       mPooledClients.pop();
-      Task* task = nullptr;
       // If a pooled TextureClient is not compatible, release it.
       if (textureHolder->GetTextureClient()->GetFormat() != aFormat ||
           textureHolder->GetTextureClient()->GetSize() != aSize) {
-        // Release TextureClient.
-        task = new TextureClientReleaseTask(textureHolder->GetTextureClient());
+        TextureClientReleaseTask* task = new TextureClientReleaseTask(textureHolder->GetTextureClient());
         textureHolder->ClearTextureClient();
         textureHolder = nullptr;
+        // Release TextureClient.
+        mSurfaceAllocator->GetMessageLoop()->PostTask(FROM_HERE, task);
       } else {
-        task = new TextureClientRecycleTask(textureHolder->GetTextureClient(), aTextureFlags);
+        textureHolder->GetTextureClient()->RecycleTexture(aTextureFlags);
       }
-      mSurfaceAllocator->GetMessageLoop()->PostTask(FROM_HERE, task);
     }
   }
 
   if (!textureHolder) {
     // Allocate new TextureClient
     RefPtr<TextureClient> texture = Allocate(aFormat, aSize, aSelector, aTextureFlags, aAllocFlags);
     if (!texture) {
       return nullptr;