Backed out changeset 224fe2a12a04 (bug 779029) for Windows reftest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 15 Nov 2012 21:34:14 -0500
changeset 113464 c2e247f9d207ea850dba5cc7e15ca1b9956e2119
parent 113463 514bf72036719a760c1b355d91f4a18ea1a01d6e
child 113465 ef467dfbbc0d4d7dc738179c83c35dba2a6648ba
push id23872
push useremorley@mozilla.com
push dateFri, 16 Nov 2012 17:06:27 +0000
treeherdermozilla-central@a7ed19f7d21a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs779029
milestone19.0a1
backs out224fe2a12a04c5edb6ec7a1b9d0cad1890f8e66f
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
Backed out changeset 224fe2a12a04 (bug 779029) for Windows reftest failures.
gfx/thebes/gfxContext.cpp
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -1397,61 +1397,36 @@ gfxContext::GetPattern()
 // masking
 
 void
 gfxContext::Mask(gfxPattern *pattern)
 {
   if (mCairo) {
     cairo_mask(mCairo, pattern->CairoPattern());
   } else {
-    bool needsClip = false;
-    if (pattern->GetType() == gfxPattern::PATTERN_SURFACE &&
-        pattern->Extend() == gfxPattern::EXTEND_NONE) {
-      // In this situation the mask will be fully transparent (i.e. nothing
-      // will be drawn) outside of the bounds of the surface. We can support
-      // that by clipping out drawing to that area.
-      needsClip = true;
-      nsRefPtr<gfxASurface> surf = pattern->GetSurface();
-      gfxPoint offset = surf->GetDeviceOffset();
-
-      Matrix mat = ToMatrix(pattern->GetMatrix());
-      mat.Invert();
-      mat = GetDTTransform() * mat;
-      mDT->SetTransform(mat);
-      mDT->PushClipRect(Rect(offset.x, offset.y, surf->GetSize().width, surf->GetSize().height));
-      mDT->SetTransform(GetDTTransform());
-    }
     mDT->Mask(GeneralPattern(this), *pattern->GetPattern(mDT), DrawOptions(1.0f, CurrentState().op, CurrentState().aaMode));
-
-    if (needsClip) {
-      mDT->PopClip();
-    }
   }
 }
 
 void
 gfxContext::Mask(gfxASurface *surface, const gfxPoint& offset)
 {
   SAMPLE_LABEL("gfxContext", "Mask");
   if (mCairo) {
     cairo_mask_surface(mCairo, surface->CairoSurface(), offset.x, offset.y);
   } else {
     // Lifetime needs to be limited here as we may simply wrap surface's data.
     RefPtr<SourceSurface> sourceSurf =
       gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(mDT, surface);
 
     gfxPoint pt = surface->GetDeviceOffset();
-
-    // We clip here to bind to the mask surface bounds, see above.
-    mDT->PushClipRect(Rect(offset.x, offset.y, sourceSurf->GetSize().width, sourceSurf->GetSize().height));
     mDT->Mask(GeneralPattern(this), 
               SurfacePattern(sourceSurf, EXTEND_CLAMP,
                              Matrix(1.0f, 0, 0, 1.0f, Float(offset.x - pt.x), Float(offset.y - pt.y))),
               DrawOptions(1.0f, CurrentState().op, CurrentState().aaMode));
-    mDT->PopClip();
   }
 }
 
 void
 gfxContext::Paint(gfxFloat alpha)
 {
   SAMPLE_LABEL("gfxContext", "Paint");
   if (mCairo) {