update rgnrectallocator changes to match pending m-c patch.
authorChris Jones <jones.chris.g@gmail.com>
Tue, 14 Jul 2009 03:09:23 -0500
changeset 35782 f64cd78eb6472babbdd0ae38e17161ff019aa291
parent 35781 5cca4891baeaea536d9584915a575ea3b3b143d3
child 35783 98f09b4de66d215e98aa5868af289defd5895905
push id10694
push userbsmedberg@mozilla.com
push dateMon, 14 Dec 2009 15:23:10 +0000
treeherdermozilla-central@683dfdc4adf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
update rgnrectallocator changes to match pending m-c patch.
gfx/src/nsRegion.cpp
gfx/thebes/src/gfxPlatform.cpp
ipc/glue/GeckoThread.cpp
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -97,17 +97,17 @@ class RgnRectMemoryAllocator
 
   void InitLock ()    { mLock = PR_NewLock (); }
   void DestroyLock () { PR_DestroyLock (mLock); }
   void Lock ()        { PR_Lock   (mLock); }
   void Unlock ()      { PR_Unlock (mLock); }
 #elif defined (DEBUG)
   struct _ {
     _() { mThread = PR_CurrentThread(); }
-      void* GetThread() { return mThread; }
+    void* GetThread() { return mThread; }
     void* mThread;
   } _mOwningThread;
 
   void InitLock ()    { NS_ASSERT_OWNINGTHREAD (RgnRectMemoryAllocator); }
   void DestroyLock () { NS_ASSERT_OWNINGTHREAD (RgnRectMemoryAllocator); }
   void Lock ()        { NS_ASSERT_OWNINGTHREAD (RgnRectMemoryAllocator); }
   void Unlock ()      { NS_ASSERT_OWNINGTHREAD (RgnRectMemoryAllocator); }
 #else
@@ -141,17 +141,17 @@ public:
   RgnRectMemoryAllocator (PRUint32 aNumOfEntries);
  ~RgnRectMemoryAllocator ();
 
   nsRegion::RgnRect* Alloc ();
   void Free (nsRegion::RgnRect* aRect);
 
 #if defined(DEBUG)
   void SetOwningThread(void* aOwningThread) {
-      _mOwningThread.mThread = aOwningThread;
+    _mOwningThread.mThread = aOwningThread;
   }
 #endif
 };
 
 
 RgnRectMemoryAllocator::RgnRectMemoryAllocator (PRUint32 aNumOfEntries)
 {
   InitLock ();
--- a/gfx/thebes/src/gfxPlatform.cpp
+++ b/gfx/thebes/src/gfxPlatform.cpp
@@ -66,16 +66,18 @@
 #include "cairo.h"
 #include "qcms.h"
 
 #include "plstr.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefBranch2.h"
 
+#include "nsRegion.h"
+
 gfxPlatform *gPlatform = nsnull;
 
 // These two may point to the same profile
 static qcms_profile *gCMSOutputProfile = nsnull;
 static qcms_profile *gCMSsRGBProfile = nsnull;
 
 static qcms_transform *gCMSRGBTransform = nsnull;
 static qcms_transform *gCMSInverseRGBTransform = nsnull;
@@ -177,16 +179,18 @@ gfxPlatform::Init()
 #elif defined(XP_BEOS)
     gPlatform = new gfxBeOSPlatform;
 #elif defined(XP_OS2)
     gPlatform = new gfxOS2Platform;
 #endif
     if (!gPlatform)
         return NS_ERROR_OUT_OF_MEMORY;
 
+    nsRegion::MigrateToCurrentThread();
+
     nsresult rv;
 
 #if defined(XP_MACOSX)
     rv = gfxQuartzFontCache::Init();
     if (NS_FAILED(rv)) {
         NS_ERROR("Could not initialize gfxQuartzFontCache");
         Shutdown();
         return rv;
--- a/ipc/glue/GeckoThread.cpp
+++ b/ipc/glue/GeckoThread.cpp
@@ -61,18 +61,16 @@ void
 GeckoThread::Init()
 {
   ChildThread::Init();
 
   // Certain plugins, such as flash, steal the unhandled exception filter
   // thus we never get crash reports when they fault. This call fixes it.
   message_loop()->set_exception_restoration(true);
 
-  nsRegion::MigrateToCurrentThread();
-
   NS_LogInit();
   mXREEmbed.Start();
 }
 
 void
 GeckoThread::CleanUp()
 {
   mXREEmbed.Stop();