Bug 1253094, part 2 - Stop using DebugOnly for class/struct members in gfx/. r=Bas draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 02 Mar 2016 23:49:47 +0000
changeset 336253 8dba83cfdcf95572c104297624fa42966d47c15c
parent 336252 979a5d4d3dcc833973a000efa7e9fdb10c97d601
child 336254 bfbe7da37231e83b3d2bdf52b721281759c48db1
push id12025
push userjwatt@jwatt.org
push dateThu, 03 Mar 2016 00:03:10 +0000
reviewersBas
bugs1253094
milestone47.0a1
Bug 1253094, part 2 - Stop using DebugOnly for class/struct members in gfx/. r=Bas MozReview-Commit-ID: JmMHpmZ34ok
gfx/gl/SharedSurface.h
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/layers/client/TextureClient.h
gfx/layers/ipc/AsyncTransactionTracker.cpp
gfx/layers/ipc/AsyncTransactionTracker.h
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxContext.h
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -63,17 +63,19 @@ public:
     GLContext* const mGL;
     const gfx::IntSize mSize;
     const bool mHasAlpha;
     const bool mCanRecycle;
 protected:
     bool mIsLocked;
     bool mIsProducerAcquired;
     bool mIsConsumerAcquired;
-    DebugOnly<nsIThread* const> mOwningThread;
+#ifdef DEBUG
+    nsIThread* const mOwningThread;
+#endif
 
     SharedSurface(SharedSurfaceType type,
                   AttachmentType attachType,
                   GLContext* gl,
                   const gfx::IntSize& size,
                   bool hasAlpha,
                   bool canRecycle);
 
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -245,17 +245,19 @@ Layer::Layer(LayerManager* aManager, voi
   mIsFixedPosition(false),
   mTransformIsPerspective(false),
   mFixedPositionData(nullptr),
   mStickyPositionData(nullptr),
   mScrollbarTargetId(FrameMetrics::NULL_SCROLL_ID),
   mScrollbarDirection(ScrollDirection::NONE),
   mScrollbarThumbRatio(0.0f),
   mIsScrollbarContainer(false),
+#ifdef DEBUG
   mDebugColorIndex(0),
+#endif
   mAnimationGeneration(0)
 {
   MOZ_COUNT_CTOR(Layer);
 }
 
 Layer::~Layer()
 {
   MOZ_COUNT_DTOR(Layer);
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1829,17 +1829,19 @@ protected:
   nsAutoPtr<StickyPositionData> mStickyPositionData;
   FrameMetrics::ViewID mScrollbarTargetId;
   ScrollDirection mScrollbarDirection;
   // The scrollbar thumb ratio is the ratio of the thumb position (in the CSS
   // pixels of the scrollframe's parent's space) to the scroll position (in the
   // CSS pixels of the scrollframe's space).
   float mScrollbarThumbRatio;
   bool mIsScrollbarContainer;
-  DebugOnly<uint32_t> mDebugColorIndex;
+#ifdef DEBUG
+  uint32_t mDebugColorIndex;
+#endif
   // If this layer is used for OMTA, then this counter is used to ensure we
   // stay in sync with the animation manager
   uint64_t mAnimationGeneration;
 #ifdef MOZ_DUMP_PAINTING
   nsTArray<nsCString> mExtraDumpInfo;
 #endif
   // Store display list log.
   nsCString mDisplayListLog;
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -618,17 +618,19 @@ protected:
   RefPtr<gfx::DrawTarget> mBorrowedDrawTarget;
 
   TextureFlags mFlags;
   FenceHandle mReleaseFenceHandle;
   FenceHandle mAcquireFenceHandle;
   gl::GfxTextureWasteTracker mWasteTracker;
 
   OpenMode mOpenMode;
-  DebugOnly<uint32_t> mExpectedDtRefs;
+#ifdef DEBUG
+  uint32_t mExpectedDtRefs;
+#endif
   bool mIsLocked;
 
   bool mAddedToCompositableClient;
   bool mWorkaroundAnnoyingSharedSurfaceLifetimeIssues;
   bool mWorkaroundAnnoyingSharedSurfaceOwnershipIssues;
 
   RefPtr<TextureReadbackSink> mReadbackSink;
 
@@ -673,33 +675,39 @@ public:
   TextureClientAutoLock(TextureClient* aTexture, OpenMode aMode
                         MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
    : mTexture(aTexture),
      mSucceeded(false)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
     mSucceeded = mTexture->Lock(aMode);
+#ifdef DEBUG
     mChecked = false;
+#endif
   }
   ~TextureClientAutoLock() {
     MOZ_ASSERT(mChecked);
     if (mSucceeded) {
       mTexture->Unlock();
     }
   }
 
   bool Succeeded() {
+#ifdef DEBUG
     mChecked = true;
+#endif
     return mSucceeded;
   }
 
 private:
   TextureClient* mTexture;
-  DebugOnly<bool> mChecked;
+#ifdef DEBUG
+  bool mChecked;
+#endif
   bool mSucceeded;
 };
 
 class KeepAlive
 {
 public:
   virtual ~KeepAlive() {}
 };
--- a/gfx/layers/ipc/AsyncTransactionTracker.cpp
+++ b/gfx/layers/ipc/AsyncTransactionTracker.cpp
@@ -37,43 +37,49 @@ AsyncTransactionWaiter::WaitComplete()
 }
 
 uint64_t AsyncTransactionTracker::sSerialCounter(0);
 Mutex* AsyncTransactionTracker::sLock = nullptr;
 
 AsyncTransactionTracker::AsyncTransactionTracker(AsyncTransactionWaiter* aWaiter)
     : mSerial(GetNextSerial())
     , mWaiter(aWaiter)
+#ifdef DEBUG
     , mCompleted(false)
+#endif
 {
   if (mWaiter) {
     mWaiter->IncrementWaitCount();
   }
 }
 
 AsyncTransactionTracker::~AsyncTransactionTracker()
 {
 }
 
 void
 AsyncTransactionTracker::NotifyComplete()
 {
   MOZ_ASSERT(!mCompleted);
+#ifdef DEBUG
   mCompleted = true;
+#endif
   Complete();
   if (mWaiter) {
     mWaiter->DecrementWaitCount();
   }
 }
 
 void
 AsyncTransactionTracker::NotifyCancel()
 {
   MOZ_ASSERT(!mCompleted);
+#ifdef DEBUG
   mCompleted = true;
+#endif
   Cancel();
   if (mWaiter) {
     mWaiter->DecrementWaitCount();
   }
 }
 
 uint64_t AsyncTransactionTrackersHolder::sSerialCounter(0);
 Mutex* AsyncTransactionTrackersHolder::sHolderLock = nullptr;
--- a/gfx/layers/ipc/AsyncTransactionTracker.h
+++ b/gfx/layers/ipc/AsyncTransactionTracker.h
@@ -126,17 +126,19 @@ protected:
     MOZ_ASSERT(sLock);
     MutexAutoLock lock(*sLock);
     ++sSerialCounter;
     return sSerialCounter;
   }
 
   uint64_t mSerial;
   RefPtr<AsyncTransactionWaiter> mWaiter;
-  DebugOnly<bool> mCompleted;
+#ifdef DEBUG
+  bool mCompleted;
+#endif
 
   /**
    * gecko does not provide atomic operation for uint64_t.
    * Ensure atomicity by using Mutex.
    */
   static uint64_t sSerialCounter;
   static Mutex* sLock;
 };
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -813,17 +813,19 @@ gfxContext::PushGroupForBlendBack(gfxCon
 
     if (oldDT != mDT) {
       PushClipsToDT(mDT);
     }
     mDT->SetTransform(GetDTTransform());
 
     CurrentState().mBlendOpacity = aOpacity;
     CurrentState().mBlendMask = aMask;
+#ifdef DEBUG
     CurrentState().mWasPushedForBlendBack = true;
+#endif
     CurrentState().mBlendMaskTransform = aMaskTransform;
   }
 }
 
 static gfxRect
 GetRoundOutDeviceClipExtents(gfxContext* aCtx)
 {
   gfxContextMatrixAutoSaveRestore save(aCtx);
@@ -865,17 +867,19 @@ gfxContext::PushGroupAndCopyBackground(g
 
       if (oldDT == mDT) {
         // Creating new DT failed.
         return;
       }
 
       CurrentState().mBlendOpacity = aOpacity;
       CurrentState().mBlendMask = aMask;
+#ifdef DEBUG
       CurrentState().mWasPushedForBlendBack = true;
+#endif
       CurrentState().mBlendMaskTransform = aMaskTransform;
 
       Point offset = CurrentState().deviceOffset - oldDeviceOffset;
       Rect surfRect(0, 0, Float(mDT->GetSize().width), Float(mDT->GetSize().height));
       Rect sourceRect = surfRect + offset;
 
       mDT->SetTransform(Matrix());
 
@@ -913,17 +917,19 @@ gfxContext::PushGroupAndCopyBackground(g
 
     if (oldDT != mDT) {
       PushClipsToDT(mDT);
     }
 
     mDT->SetTransform(GetDTTransform());
     CurrentState().mBlendOpacity = aOpacity;
     CurrentState().mBlendMask = aMask;
+#ifdef DEBUG
     CurrentState().mWasPushedForBlendBack = true;
+#endif
     CurrentState().mBlendMaskTransform = aMaskTransform;
   }
 }
 
 void
 gfxContext::PopGroupAndBlend()
 {
   if (gfxPrefs::UseNativePushLayer()) {
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -502,17 +502,19 @@ private:
     Matrix patternTransform;
     Color fontSmoothingBackgroundColor;
     // This is used solely for using minimal intermediate surface size.
     mozilla::gfx::Point deviceOffset;
     // Support groups
     mozilla::gfx::Float mBlendOpacity;
     RefPtr<SourceSurface> mBlendMask;
     Matrix mBlendMaskTransform;
-    mozilla::DebugOnly<bool> mWasPushedForBlendBack;
+#ifdef DEBUG
+    bool mWasPushedForBlendBack;
+#endif
   };
 
   // This ensures mPath contains a valid path (in user space!)
   void EnsurePath();
   // This ensures mPathBuilder contains a valid PathBuilder (in user space!)
   void EnsurePathBuilder();
   void FillAzure(const Pattern& aPattern, mozilla::gfx::Float aOpacity);
   void PushClipsToDT(mozilla::gfx::DrawTarget *aDT);