Bug 1378476 - Label layers::DestroyTextureData. r=nical
authorBevis Tseng <btseng@mozilla.com>
Wed, 19 Jul 2017 14:23:19 +0800
changeset 369778 0dce1ed65c8b02c047ed024c2be7092ef67c436f
parent 369777 4f740894454e7d3fab18e2926391fdca1d8a9121
child 369779 7d8a372d113f3985735a1c3f35ec791b43f12264
push id92747
push userbtseng@mozilla.com
push dateThu, 20 Jul 2017 05:47:18 +0000
treeherdermozilla-inbound@bed655e34ed9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1378476
milestone56.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 1378476 - Label layers::DestroyTextureData. r=nical
gfx/layers/client/TextureClient.cpp
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/TextureClient.h"
 #include <stdint.h>                     // for uint8_t, uint32_t, etc
 #include "Layers.h"                     // for Layer, etc
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"                // for gfxPlatform
 #include "mozilla/Atomics.h"
+#include "mozilla/SystemGroup.h"
 #include "mozilla/ipc/SharedMemory.h"   // for SharedMemory, etc
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/layers/TextureClientRecycleAllocator.h"
 #include "mozilla/Mutex.h"
 #include "nsDebug.h"                    // for NS_ASSERTION, NS_WARNING, etc
@@ -229,21 +230,21 @@ static void DestroyTextureData(TextureDa
                                bool aDeallocate, bool aMainThreadOnly)
 {
   if (!aTextureData) {
     return;
   }
 
   if (aMainThreadOnly && !NS_IsMainThread()) {
     RefPtr<LayersIPCChannel> allocatorRef = aAllocator;
-    NS_DispatchToMainThread(NS_NewRunnableFunction(
-      "layers::DestroyTextureData",
-      [aTextureData, allocatorRef, aDeallocate]() -> void {
-        DestroyTextureData(aTextureData, allocatorRef, aDeallocate, true);
-      }));
+    SystemGroup::Dispatch(nullptr, TaskCategory::Other, NS_NewRunnableFunction(
+        "layers::DestroyTextureData",
+        [aTextureData, allocatorRef, aDeallocate]() -> void {
+          DestroyTextureData(aTextureData, allocatorRef, aDeallocate, true);
+        }));
     return;
   }
 
   if (aDeallocate) {
     aTextureData->Deallocate(aAllocator);
   } else {
     aTextureData->Forget(aAllocator);
   }