Backing out 3883e79e5a9a and 0653a37b7230 (bug 601064) due to test failures, a=backout
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 04 Jan 2011 17:48:11 +1300
changeset 59823 e3b1c75995acf9c2572908bb9c23a7e7f57baa7c
parent 59822 9713b198fe3d41b5f706deb16b42785b7164ab3f
child 59824 aa5e8e362cb2e02209767833ec7e5a215b713230
push id17802
push userrocallahan@mozilla.com
push dateTue, 04 Jan 2011 04:49:23 +0000
treeherdermozilla-central@e3b1c75995ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs601064
milestone2.0b9pre
first release with
nightly linux32
e3b1c75995ac / 4.0b9pre / 20110104030354 / files
nightly linux64
e3b1c75995ac / 4.0b9pre / 20110104030354 / files
nightly mac
e3b1c75995ac / 4.0b9pre / 20110104030354 / files
nightly win32
e3b1c75995ac / 4.0b9pre / 20110104030354 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Backing out 3883e79e5a9a and 0653a37b7230 (bug 601064) due to test failures, a=backout
dom/plugins/PluginInstanceChild.cpp
dom/plugins/PluginInstanceChild.h
modules/plugin/test/mochitest/test_painting.html
--- a/dom/plugins/PluginInstanceChild.cpp
+++ b/dom/plugins/PluginInstanceChild.cpp
@@ -138,17 +138,16 @@ PluginInstanceChild::PluginInstanceChild
     , mLayersRendering(false)
     , mAccumulatedInvalidRect(0,0,0,0)
     , mIsTransparent(false)
     , mSurfaceType(gfxASurface::SurfaceTypeMax)
     , mCurrentInvalidateTask(nsnull)
     , mCurrentAsyncSetWindowTask(nsnull)
     , mPendingPluginCall(false)
     , mDoAlphaExtraction(false)
-    , mHasPainted(false)
     , mSurfaceDifferenceRect(0,0,0,0)
 #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
     , mMaemoImageRendering(PR_FALSE)
 #endif
 {
     memset(&mWindow, 0, sizeof(mWindow));
     mData.ndata = (void*) this;
     mData.pdata = nsnull;
@@ -2468,18 +2467,17 @@ PluginInstanceChild::UpdateWindowAttribu
     // Windowless plugins on Windows need a WM_WINDOWPOSCHANGED event to update
     // their location... or at least Flash does: Silverlight uses the
     // window.x/y passed to NPP_SetWindow
 
     if (mPluginIface->event) {
         WINDOWPOS winpos = {
             0, 0,
             mWindow.x, mWindow.y,
-            mWindow.width, mWindow.height,
-            0
+            mWindow.width, mWindow.height
         };
         NPEvent pluginEvent = {
             WM_WINDOWPOSCHANGED, 0,
             (LPARAM) &winpos
         };
         mPluginIface->event(&mData, &pluginEvent);
     }
 #endif
@@ -2715,17 +2713,16 @@ PluginInstanceChild::ShowPluginFrame()
         rect.SetRect(0, 0, mWindow.width, mWindow.height);
     }
 
     if (mDoAlphaExtraction) {
         PaintRectWithAlphaExtraction(rect, mCurrentSurface);
     } else {
         PaintRectToSurface(rect, mCurrentSurface, gfxRGBA(0.0, 0.0, 0.0, 0.0));
     }
-    mHasPainted = true;
 
     NPRect r = { (uint16_t)rect.y, (uint16_t)rect.x,
                  (uint16_t)rect.YMost(), (uint16_t)rect.XMost() };
     SurfaceDescriptor currSurf;
 #ifdef MOZ_X11
     if (mCurrentSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
         gfxXlibSurface *xsurf = static_cast<gfxXlibSurface*>(mCurrentSurface.get());
         currSurf = SurfaceDescriptorX11(xsurf->XDrawable(), xsurf->XRenderFormat()->id,
@@ -2813,29 +2810,29 @@ PluginInstanceChild::ReadbackDifferenceR
 void
 PluginInstanceChild::InvalidateRectDelayed(void)
 {
     if (!mCurrentInvalidateTask) {
         return;
     }
 
     mCurrentInvalidateTask = nsnull;
-    if (mAccumulatedInvalidRect.IsEmpty() || (mHasPainted && !IsVisible())) {
+    if (mAccumulatedInvalidRect.IsEmpty() || !IsVisible()) {
         return;
     }
 
     if (!ShowPluginFrame()) {
         AsyncShowPluginFrame();
     }
 }
 
 void
 PluginInstanceChild::AsyncShowPluginFrame(void)
 {
-    if (mCurrentInvalidateTask || (mHasPainted && !IsVisible())) {
+    if (mCurrentInvalidateTask || !IsVisible()) {
         return;
     }
 
     mCurrentInvalidateTask =
         NewRunnableMethod(this, &PluginInstanceChild::InvalidateRectDelayed);
     MessageLoop::current()->PostTask(FROM_HERE, mCurrentInvalidateTask);
 }
 
--- a/dom/plugins/PluginInstanceChild.h
+++ b/dom/plugins/PluginInstanceChild.h
@@ -493,21 +493,16 @@ private:
     // that surface here.
     nsRefPtr<gfxASurface> mHelperSurface;
 
     // true when plugin does not support painting to ARGB32 surface
     // this is false for maemo platform, and false if plugin
     // supports NPPVpluginTransparentAlphaBool (which is not part of NPAPI yet)
     bool mDoAlphaExtraction;
 
-    // true when the plugin has painted at least once. We use this to ensure
-    // that we ask a plugin to paint at least once even if it's invisible;
-    // some plugin (instances) rely on this in order to work properly.
-    bool mHasPainted;
-
     // Cached rectangle rendered to previous surface(mBackSurface)
     // Used for reading back to current surface and syncing data,
     // in plugin coordinates.
     nsIntRect mSurfaceDifferenceRect;
 
 #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
     // Maemo5 Flash does not remember WindowlessLocal state
     // we should listen for NPP values negotiation and remember it
--- a/modules/plugin/test/mochitest/test_painting.html
+++ b/modules/plugin/test/mochitest/test_painting.html
@@ -64,17 +64,17 @@ function initialize() {
   clip = document.getElementById("clip");
   clipped = document.getElementById("clipped");
 
   is(paint_waiter.getPaintCount(), 0, "zero-sized plugin not painted");
   waitForPaint(show);
 }
 
 function show() {
-  is(clipped.getPaintCount(), 1, "fully clipped plugin painted exactly once");
+  is(clipped.getPaintCount(), 0, "fully clipped plugin not painted");
 
   clip.style.height = "10px";
 
   // Capturing an image (as in a reftest) would force a repaint and use
   // different paths for the image surface, so instead check the plugin's
   // paint count.
   waitForPaint(invalidate);
 }
@@ -89,27 +89,27 @@ function doubleForDoublePass() {
       return 2;
   }
   catch (e) { }
 
   return 1;
 }
 
 function invalidate() {
-  var paintCount = 2 * doubleForDoublePass();
+  var paintCount = 1 * doubleForDoublePass();
 
-  is(clipped.getPaintCount(), paintCount, "partially clipped plugin painted twice");  
+  is(clipped.getPaintCount(), paintCount, "partially clipped plugin painted once");  
   
   clipped.setColor("FF00FF00"); // plugin invalidates
 
   waitForPaint(done);
 }
 
 function done() {
-  var paintCount = 3 * doubleForDoublePass();
+  var paintCount = 2 * doubleForDoublePass();
   is(clipped.getPaintCount(), paintCount, "painted after invalidate");
 
   SimpleTest.finish();  
 }
 
 function waitForPaint(func) {
   paint_waiter.last_paint_count = paint_waiter.getPaintCount();
   // Ensure the waiter has been reflowed with zero height, so that this will