Bug 959842. Fix PGO only crash calling ReturnDrawTarget. r=mattwoodrow
authorNicholas Cameron <ncameron@mozilla.com>
Fri, 24 Jan 2014 19:58:29 +1300
changeset 164985 2e93f0faa6ad80c1260913dc54c80bce688e15d3
parent 164984 5b206fc5ecb67f4dc5b99f13a9278ab24487d26c
child 164986 dc8f8287710bf66f3b939f675afc1000e8b8ac70
push id38869
push userncameron@mozilla.com
push dateFri, 24 Jan 2014 06:58:46 +0000
treeherdermozilla-inbound@dc8f8287710b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs959842
milestone29.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 959842. Fix PGO only crash calling ReturnDrawTarget. r=mattwoodrow
gfx/layers/client/ContentClient.h
--- a/gfx/layers/client/ContentClient.h
+++ b/gfx/layers/client/ContentClient.h
@@ -93,17 +93,17 @@ public:
   {}
 
 
   virtual void Clear() = 0;
   virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
                                                             uint32_t aFlags) = 0;
   virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
                                                        const RotatedContentBuffer::PaintState& aPaintState) = 0;
-  virtual void ReturnDrawTarget(gfx::DrawTarget* aReturned) = 0;
+  virtual void ReturnDrawTarget(gfx::DrawTarget*& aReturned) = 0;
 
   virtual void PrepareFrame() {}
 
   // Called as part of the layers transation reply. Conveys data about our
   // buffer(s) from the compositor. If appropriate we should swap references
   // to our buffers.
   virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) {}
 
@@ -143,17 +143,17 @@ public:
   {
     return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
   }
   virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
                                                        const PaintState& aPaintState) MOZ_OVERRIDE
   {
     return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
   }
-  virtual void ReturnDrawTarget(gfx::DrawTarget* aReturned) MOZ_OVERRIDE
+  virtual void ReturnDrawTarget(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
   {
     BorrowDrawTarget::ReturnDrawTarget(aReturned);
   }
 
   void DrawTo(ThebesLayer* aLayer,
               gfx::DrawTarget* aTarget,
               float aOpacity,
               gfx::CompositionOp aOp,
@@ -213,17 +213,17 @@ public:
   {
     return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
   }
   virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
                                                        const PaintState& aPaintState) MOZ_OVERRIDE
   {
     return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
   }
-  virtual void ReturnDrawTarget(gfx::DrawTarget* aReturned) MOZ_OVERRIDE
+  virtual void ReturnDrawTarget(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
   {
     BorrowDrawTarget::ReturnDrawTarget(aReturned);
   }
 
   /**
    * Begin/End Paint map a gfxASurface from the texture client
    * into the buffer of RotatedBuffer. The surface is only
    * valid when the texture client is locked, so is mapped out
@@ -323,17 +323,17 @@ public:
   {
     return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
   }
   virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
                                                        const PaintState& aPaintState) MOZ_OVERRIDE
   {
     return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
   }
-  virtual void ReturnDrawTarget(gfx::DrawTarget* aReturned) MOZ_OVERRIDE
+  virtual void ReturnDrawTarget(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
   {
     BorrowDrawTarget::ReturnDrawTarget(aReturned);
   }
 
   /**
    * Begin/End Paint map a gfxASurface from the texture client
    * into the buffer of RotatedContentBuffer. The surface is only
    * valid when the texture client is locked, so is mapped out
@@ -558,17 +558,17 @@ public:
     mHasBuffer = false;
     mHasBufferOnWhite = false;
   }
 
   virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
                                       uint32_t aFlags) MOZ_OVERRIDE;
   virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
                                                        const PaintState& aPaintState) MOZ_OVERRIDE;
-  virtual void ReturnDrawTarget(gfx::DrawTarget* aReturned) MOZ_OVERRIDE
+  virtual void ReturnDrawTarget(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
   {
     BorrowDrawTarget::ReturnDrawTarget(aReturned);
   }
 
   virtual void Updated(const nsIntRegion& aRegionToDraw,
                        const nsIntRegion& aVisibleRegion,
                        bool aDidSelfCopy);