Bug 862448 - Fix the fast fencing path for GL when drawing buffer is preserved r=jgilbert
☠☠ backed out by be0e8115a215 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Thu, 25 Apr 2013 09:28:04 -0400
changeset 140808 ba934ac9fc6bdb2e91882600ab2d2088cbdf096b
parent 140807 b49b5f42be79bf9290a0beca397e4ec7fbe054f4
child 140809 1264667a08548b68226470ac1765f21064d4731e
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs862448
milestone23.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 862448 - Fix the fast fencing path for GL when drawing buffer is preserved r=jgilbert
gfx/gl/SurfaceStream.cpp
--- a/gfx/gl/SurfaceStream.cpp
+++ b/gfx/gl/SurfaceStream.cpp
@@ -306,36 +306,30 @@ SurfaceStream_TripleBuffer_Copy::Surrend
 SharedSurface*
 SurfaceStream_TripleBuffer_Copy::SwapProducer(SurfaceFactory* factory,
                                               const gfxIntSize& size)
 {
     MonitorAutoLock lock(mMonitor);
 
     RecycleScraps(factory);
     if (mProducer) {
-        if (mStaging && mStaging->Type() != factory->Type())
+        if (mStaging) {
+            // We'll re-use this for a new mProducer later on if
+            // the size remains the same
             Recycle(factory, mStaging);
-
-        if (!mStaging)
-            New(factory, mProducer->Size(), mStaging);
+        }
 
-        if (!mStaging)
-            return nullptr;
-
-        SharedSurface::Copy(mProducer, mStaging, factory);
-        // Fence now, before we start (maybe) juggling Prod around.
+        Move(mProducer, mStaging);
         mStaging->Fence();
 
-        if (mProducer->Size() != size)
-            Recycle(factory, mProducer);
-    }
-
-    // The old Prod (if there every was one) was invalid,
-    // so we need a new one.
-    if (!mProducer) {
+        New(factory, size, mProducer);
+        
+        if (mStaging->Size() == mProducer->Size())
+            SharedSurface::Copy(mStaging, mProducer, factory);
+    } else {
         New(factory, size, mProducer);
     }
 
     return mProducer;
 }
 
 
 SharedSurface*