Back out 156eaa94f73c (bug 782786) and 05d1a3fba90b (bug 777028) for frequent Linux reftest failures on a CLOSED TREE
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 23 Aug 2012 14:47:07 -0700
changeset 105256 c95b9d40a1738112574959718f08d1e19c6d99a5
parent 105255 f49728317fad7ec0566200749b64fceca592b5c8
child 105257 7fb25861ffd9d6b23d10d783f8e68160f3527315
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
bugs782786, 777028
milestone17.0a1
backs out156eaa94f73c9110bd521063f08fefff432209e0
Back out 156eaa94f73c (bug 782786) and 05d1a3fba90b (bug 777028) for frequent Linux reftest failures on a CLOSED TREE
content/canvas/src/WebGLContextGL.cpp
gfx/layers/basic/BasicCanvasLayer.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -3701,39 +3701,39 @@ WebGLContext::LinkProgram(nsIWebGLProgra
 void
 WebGLContext::LinkProgram(WebGLProgram *program, ErrorResult& rv)
 {
     if (!IsContextStable())
         return;
 
     if (!ValidateObject("linkProgram", program))
         return;
-
+    
     GLuint progname = program->GLName();
 
     if (!program->NextGeneration()) {
         return rv.Throw(NS_ERROR_FAILURE);
     }
 
     if (!program->HasBothShaderTypesAttached()) {
         GenerateWarning("linkProgram: this program doesn't have both a vertex shader"
                         " and a fragment shader");
         program->SetLinkStatus(false);
         return;
     }
 
     // bug 777028
     // Mesa can't handle more than 16 samplers per program, counting each array entry.
-    if (gl->WorkAroundDriverBugs() &&
-        mIsMesa &&
-        program->UpperBoundNumSamplerUniforms() > 16)
-    {
-        GenerateWarning("Programs with more than 16 samplers are disallowed on Mesa drivers " "to avoid a Mesa crasher.");
-        program->SetLinkStatus(false);
-        return;
+    if (mIsMesa) {
+        if (program->UpperBoundNumSamplerUniforms() > 16) {
+            GenerateWarning("Programs with more than 16 samplers are disallowed on Mesa drivers "
+                            "to avoid a Mesa crasher.");
+            program->SetLinkStatus(false);
+            return;
+        }
     }
 
     GLint ok;
     if (gl->WorkAroundDriverBugs() &&
         program->HasBadShaderAttached())
     {
         // it's a common driver bug, caught by program-test.html, that linkProgram doesn't
         // correctly preserve the state of an in-use program that has been attached a bad shader
--- a/gfx/layers/basic/BasicCanvasLayer.cpp
+++ b/gfx/layers/basic/BasicCanvasLayer.cpp
@@ -115,33 +115,33 @@ BasicCanvasLayer::Initialize(const Data&
   }
 
   mBounds.SetRect(0, 0, aData.mSize.width, aData.mSize.height);
 }
 
 void
 BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
 {
-  if (!mDirty)
-    return;
-  mDirty = false;
-
   if (mDrawTarget) {
     mDrawTarget->Flush();
     // TODO Fix me before turning accelerated quartz canvas by default
     //mSurface = gfxPlatform::GetPlatform()->GetThebesSurfaceForDrawTarget(mDrawTarget);
   }
 
   if (!mGLContext && aDestSurface) {
     nsRefPtr<gfxContext> tmpCtx = new gfxContext(aDestSurface);
     tmpCtx->SetOperator(gfxContext::OPERATOR_SOURCE);
     BasicCanvasLayer::PaintWithOpacity(tmpCtx, 1.0f, aMaskLayer);
     return;
   }
 
+  if (!mDirty)
+    return;
+  mDirty = false;
+
   if (mGLContext) {
     if (aDestSurface && aDestSurface->GetType() != gfxASurface::SurfaceTypeImage) {
       NS_ASSERTION(aDestSurface->GetType() == gfxASurface::SurfaceTypeImage,
                    "Destination surface must be ImageSurface type");
       return;
     }
 
     // We need to read from the GLContext
@@ -224,19 +224,16 @@ BasicCanvasLayer::UpdateSurface(gfxASurf
       mSurface = resultSurf;
     }
   }
 }
 
 void
 BasicCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
 {
-  if (!mDirty)
-    return;
-
   if (IsHidden())
     return;
   UpdateSurface();
   FireDidTransactionCallback();
   PaintWithOpacity(aContext, GetEffectiveOpacity(), aMaskLayer);
 }
 
 void
@@ -391,19 +388,16 @@ BasicShadowableCanvasLayer::Initialize(c
 void
 BasicShadowableCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
 {
   if (!HasShadow()) {
     BasicCanvasLayer::Paint(aContext, aMaskLayer);
     return;
   }
 
-  if (!mDirty)
-    return;
-
   if (mGLContext &&
       !mForceReadback &&
       BasicManager()->GetParentBackendType() == mozilla::layers::LAYERS_OPENGL) {
     TextureImage::TextureShareType flags;
     // if process type is default, then it is single-process (non-e10s)
     if (XRE_GetProcessType() == GeckoProcessType_Default)
       flags = TextureImage::ThreadShared;
     else