b=810426 Flush() old surfaces before the plugin may redraw r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Sun, 11 Nov 2012 21:10:32 -0800
changeset 112984 447ab08591afe523ebc9634de3dd8237044bf114
parent 112983 da9fc6bdeae0983cd060490ded6fb1a028da9f89
child 112985 907883fa76f192b4e77d21c847823b00cbc278f0
push id23847
push userphilringnalda@gmail.com
push dateTue, 13 Nov 2012 05:07:25 +0000
treeherdermozilla-central@1b0226622e94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs810426
milestone19.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
b=810426 Flush() old surfaces before the plugin may redraw r=roc
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/test/reftest/reftest.list
dom/plugins/test/reftest/update-1.html
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -594,29 +594,33 @@ PluginInstanceParent::RecvShow(const NPR
 #ifdef XP_WIN
     else if (newSurface.type() == SurfaceDescriptor::TPPluginSurfaceParent) {
         PluginSurfaceParent* s =
             static_cast<PluginSurfaceParent*>(newSurface.get_PPluginSurfaceParent());
         surface = s->Surface();
     }
 #endif
 
-#ifdef MOZ_X11
-    if (mFrontSurface &&
-        mFrontSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
+    if (mFrontSurface) {
         // This is the "old front buffer" we're about to hand back to
         // the plugin.  We might still have drawing operations
         // referencing it.
-        mFrontSurface->Finish();
-        // XSync here to ensure the server has finished operations on the
-        // surface before the plugin starts scribbling on it again, or
-        // worse, destroys it.
-        FinishX(DefaultXDisplay());
+#ifdef MOZ_X11
+        if (mFrontSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
+            // Finish with the surface and XSync here to ensure the server has
+            // finished operations on the surface before the plugin starts
+            // scribbling on it again, or worse, destroys it.
+            mFrontSurface->Finish();
+            FinishX(DefaultXDisplay());
+        } else 
+#endif
+        {
+            mFrontSurface->Flush();
+        }
     }
-#endif
 
     if (mFrontSurface && gfxSharedImageSurface::IsSharedImage(mFrontSurface))
         *prevSurface = static_cast<gfxSharedImageSurface*>(mFrontSurface.get())->GetShmem();
     else
         *prevSurface = null_t();
 
     if (surface) {
         // Notify the cairo backend that this surface has changed behind
--- a/dom/plugins/test/reftest/reftest.list
+++ b/dom/plugins/test/reftest/reftest.list
@@ -21,10 +21,10 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background.html plugin-background-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-1-step.html plugin-background-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-2-step.html plugin-background-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-5-step.html plugin-background-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-10-step.html plugin-background-ref.html
 random-if(!haveTestPlugin) == plugin-transform-1.html plugin-transform-1-ref.html
 fails-if(!haveTestPlugin) == plugin-transform-2.html plugin-transform-2-ref.html
 skip-if(!haveTestPlugin) == shrink-1.html shrink-1-ref.html
-# skip-if(!haveTestPlugin) == update-1.html update-1-ref.html bug 810426
+skip-if(!haveTestPlugin) == update-1.html update-1-ref.html
 fails-if(!haveTestPlugin) == windowless-layers.html windowless-layers-ref.html
--- a/dom/plugins/test/reftest/update-1.html
+++ b/dom/plugins/test/reftest/update-1.html
@@ -1,12 +1,12 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <head>
-  <title>Test for bug 807728</title>
+  <title>Test for bugs 807728 and 810426</title>
   <script>
 function start()
 {
     document.removeEventListener("MozReftestInvalidate", start, false);
 
     var plugin = document.getElementById("plugin");
     var color = "FF000000";
     var color_count = 0;