Bug 708109. Remove THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING in favour of NS_ version. r=joe
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 15 Dec 2011 23:26:42 +1300
changeset 82635 4be841d52b5b7d6b38050ef8e8ed3fc06fd56dd1
parent 82634 24bde89bd5a9f72e317ca4e105070c01d75f5777
child 82636 e3d5b255e1093ac34cc4cda46bd4034454bcd2b7
push id21692
push usermbrubeck@mozilla.com
push dateThu, 15 Dec 2011 18:25:46 +0000
treeherdermozilla-central@63b93a89b30c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs708109
milestone11.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 708109. Remove THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING in favour of NS_ version. r=joe
gfx/gl/GLContext.h
gfx/layers/ImageLayers.h
gfx/layers/opengl/ImageLayerOGL.h
gfx/thebes/gfxTypes.h
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -522,17 +522,17 @@ struct THEBES_API ContextFormat
     int samples;
 
     int colorBits() const { return red + green + blue; }
 };
 
 class GLContext
     : public LibrarySymbolLoader
 {
-    THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(GLContext)
+    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GLContext)
 public:
     GLContext(const ContextFormat& aFormat,
               bool aIsOffscreen = false,
               GLContext *aSharedContext = nsnull)
       : mOffscreenFBOsDirty(false),
         mInitialized(false),
         mIsOffscreen(aIsOffscreen),
 #ifdef USE_GLES2
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -35,16 +35,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef GFX_IMAGELAYER_H
 #define GFX_IMAGELAYER_H
 
 #include "Layers.h"
 
+#include "nsISupportsImpl.h"
 #include "gfxPattern.h"
 #include "nsThreadUtils.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/mozalloc.h"
 
 class nsIOSurface;
 
@@ -69,17 +70,17 @@ enum StereoMode {
  * perform locking; when filling an Image, the Image client is responsible
  * for ensuring only one thread accesses the Image at a time, and after
  * SetImage the image is immutable.
  * 
  * When resampling an Image, only pixels within the buffer should be
  * sampled. For example, cairo images should be sampled in EXTEND_PAD mode.
  */
 class THEBES_API Image {
-  THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(Image)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Image)
 
 public:
   virtual ~Image() {}
 
   enum Format {
     /**
      * The PLANAR_YCBCR format creates a PlanarYCbCrImage. All backends should
      * support this format, because the Ogg video decoder depends on it.
@@ -127,17 +128,17 @@ protected:
 /**
  * A class that manages Images for an ImageLayer. The only reason
  * we need a separate class here is that ImageLayers aren't threadsafe
  * (because layers can only be used on the main thread) and we want to
  * be able to set the current Image from any thread, to facilitate
  * video playback without involving the main thread, for example.
  */
 class THEBES_API ImageContainer {
-  THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
 
 public:
   ImageContainer() :
     mReentrantMonitor("ImageContainer.mReentrantMonitor"),
     mPaintCount(0),
     mPreviousImagePainted(false)
   {}
 
--- a/gfx/layers/opengl/ImageLayerOGL.h
+++ b/gfx/layers/opengl/ImageLayerOGL.h
@@ -92,17 +92,17 @@ private:
 /**
  * A RecycleBin is owned by an ImageContainerOGL. We store buffers
  * and textures in it that we want to recycle from one image to the next.
  * It's a separate object from ImageContainerOGL because images need to store
  * a strong ref to their RecycleBin and we must avoid creating a
  * reference loop between an ImageContainerOGL and its active image.
  */
 class RecycleBin {
-  THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(RecycleBin)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RecycleBin)
 
   typedef mozilla::gl::GLContext GLContext;
 
 public:
   RecycleBin();
 
   void RecycleBuffer(PRUint8* aBuffer, PRUint32 aSize);
   // Returns a recycled buffer of the right size, or allocates a new buffer.
--- a/gfx/thebes/gfxTypes.h
+++ b/gfx/thebes/gfxTypes.h
@@ -84,32 +84,9 @@ typedef double gfxFloat;
  * @see nsLineLayout::NotifyOptionalBreakPosition
  */
 enum gfxBreakPriority {
     eNoBreak       = 0,
     eWordWrapBreak,
     eNormalBreak
 };
 
-#define THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(_class)                     \
-public:                                                                       \
-    nsrefcnt AddRef(void) {                                                   \
-        NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");             \
-        nsrefcnt count = NS_AtomicIncrementRefcnt(mRefCnt);                   \
-        NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                   \
-        return count;                                                         \
-    }                                                                         \
-    nsrefcnt Release(void) {                                                  \
-        NS_PRECONDITION(0 != mRefCnt, "dup release");                         \
-        nsrefcnt count = NS_AtomicDecrementRefcnt(mRefCnt);                   \
-        NS_LOG_RELEASE(this, count, #_class);                                 \
-        if (count == 0) {                                                     \
-            mRefCnt = 1; /* stabilize */                                      \
-            delete this;                                                      \
-            return 0;                                                         \
-        }                                                                     \
-        return count;                                                         \
-    }                                                                         \
-protected:                                                                    \
-    nsAutoRefCnt mRefCnt;                                                     \
-public:
-
 #endif /* GFX_TYPES_H */