Bug 947227 - Remove SurfaceStream_TripleBuffer_Async since it no longer has any users. r=jgilbert, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 21 Feb 2014 11:08:36 +1300
changeset 183001 396c0660cfda54a68c248f30a7cc7be6161b54da
parent 183000 8191c849976005e3cc2ae7111f90e5b7e32a5c9c
child 183002 f00d7bb8121c3dd98ad1120c17fc835268f0c0e7
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, sledru
bugs947227
milestone29.0a2
Bug 947227 - Remove SurfaceStream_TripleBuffer_Async since it no longer has any users. r=jgilbert, a=sledru
gfx/gl/SurfaceStream.cpp
gfx/gl/SurfaceStream.h
gfx/gl/SurfaceTypes.h
--- a/gfx/gl/SurfaceStream.cpp
+++ b/gfx/gl/SurfaceStream.cpp
@@ -37,19 +37,16 @@ SurfaceStream::CreateForType(SurfaceStre
 
     switch (type) {
         case SurfaceStreamType::SingleBuffer:
             result = new SurfaceStream_SingleBuffer(prevStream);
             break;
         case SurfaceStreamType::TripleBuffer_Copy:
             result = new SurfaceStream_TripleBuffer_Copy(prevStream);
             break;
-        case SurfaceStreamType::TripleBuffer_Async:
-            result = new SurfaceStream_TripleBuffer_Async(prevStream);
-            break;
         case SurfaceStreamType::TripleBuffer:
             result = new SurfaceStream_TripleBuffer(prevStream);
             break;
         default:
             MOZ_CRASH("Invalid Type.");
     }
 
     result->mGLContext = glContext;
@@ -410,19 +407,17 @@ SurfaceStream_TripleBuffer::SwapProducer
                                          const gfx::IntSize& size)
 {
     PROFILER_LABEL("SurfaceStream_TripleBuffer", "SwapProducer");
 
     MonitorAutoLock lock(mMonitor);
     if (mProducer) {
         RecycleScraps(factory);
 
-        // If WaitForCompositor succeeds, mStaging has moved to mConsumer.
-        // If it failed, we might have to scrap it.
-        if (mStaging && !WaitForCompositor())
+        if (mStaging)
             Scrap(mStaging);
 
         MOZ_ASSERT(!mStaging);
         Move(mProducer, mStaging);
         mStaging->Fence();
     }
 
     MOZ_ASSERT(!mProducer);
@@ -439,31 +434,10 @@ SurfaceStream_TripleBuffer::SwapConsumer
         Scrap(mConsumer);
         Move(mStaging, mConsumer);
         mMonitor.NotifyAll();
     }
 
     return mConsumer;
 }
 
-SurfaceStream_TripleBuffer_Async::SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream)
-    : SurfaceStream_TripleBuffer(SurfaceStreamType::TripleBuffer_Async, prevStream)
-{
-}
-
-SurfaceStream_TripleBuffer_Async::~SurfaceStream_TripleBuffer_Async()
-{
-}
-
-bool
-SurfaceStream_TripleBuffer_Async::WaitForCompositor()
-{
-    PROFILER_LABEL("SurfaceStream_TripleBuffer_Async", "WaitForCompositor");
-
-    // We are assumed to be locked
-    while (mStaging)
-        mMonitor.Wait();
-
-    return true;
-}
-
 } /* namespace gfx */
 } /* namespace mozilla */
--- a/gfx/gl/SurfaceStream.h
+++ b/gfx/gl/SurfaceStream.h
@@ -178,19 +178,16 @@ public:
 
 class SurfaceStream_TripleBuffer
     : public SurfaceStream
 {
 protected:
     SharedSurface* mStaging;
     SharedSurface* mConsumer;
 
-    // Returns true if we were able to wait, false if not
-    virtual bool WaitForCompositor() { return false; }
-
     // To support subclasses initializing the mType.
     SurfaceStream_TripleBuffer(SurfaceStreamType type, SurfaceStream* prevStream);
 
 public:
     SurfaceStream_TripleBuffer(SurfaceStream* prevStream);
     virtual ~SurfaceStream_TripleBuffer();
 
 private:
@@ -202,24 +199,12 @@ public:
     virtual SharedSurface* SwapProducer(SurfaceFactory* factory,
                                         const gfx::IntSize& size);
 
     virtual SharedSurface* SwapConsumer_NoWait();
 
     virtual void SurrenderSurfaces(SharedSurface*& producer, SharedSurface*& consumer);
 };
 
-class SurfaceStream_TripleBuffer_Async
-    : public SurfaceStream_TripleBuffer
-{
-protected:
-    virtual bool WaitForCompositor();
-
-public:
-    SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream);
-    virtual ~SurfaceStream_TripleBuffer_Async();
-};
-
-
 } /* namespace gfx */
 } /* namespace mozilla */
 
 #endif /* SURFACESTREAM_H_ */
--- a/gfx/gl/SurfaceTypes.h
+++ b/gfx/gl/SurfaceTypes.h
@@ -82,17 +82,16 @@ MOZ_BEGIN_ENUM_CLASS(SharedSurfaceType, 
 
     Max
 MOZ_END_ENUM_CLASS(SharedSurfaceType)
 
 
 MOZ_BEGIN_ENUM_CLASS(SurfaceStreamType, uint8_t)
     SingleBuffer,
     TripleBuffer_Copy,
-    TripleBuffer_Async,
     TripleBuffer,
     Max
 MOZ_END_ENUM_CLASS(SurfaceStreamType)
 
 
 MOZ_BEGIN_ENUM_CLASS(APITypeT, uint8_t)
     Generic = 0,