diff --git a/gfx/layers/RotatedBuffer.cpp b/gfx/layers/RotatedBuffer.cpp index fbf23bf1a384..abe5c267b951 100644 --- a/gfx/layers/RotatedBuffer.cpp +++ b/gfx/layers/RotatedBuffer.cpp @@ -229,7 +229,7 @@ RotatedContentBuffer::DrawTo(PaintedLayer* aLayer, // Bug 599189 if there is a non-integer-translation transform in aTarget, // we might sample pixels outside GetEffectiveVisibleRegion(), which is wrong // and may cause gray lines. - gfxUtils::ClipToRegionSnapped(aTarget, aLayer->GetEffectiveVisibleRegion()); + gfxUtils::ClipToRegion(aTarget, aLayer->GetEffectiveVisibleRegion()); clipped = true; } diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index a1cb27d0b6ef..8670be50d351 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -665,50 +665,25 @@ ClipToRegionInternal(gfxContext* aContext, const nsIntRegion& aRegion, } static TemporaryRef -PathFromRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, - bool aSnap) +PathFromRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion) { - Matrix mat = aTarget->GetTransform(); - const gfxFloat epsilon = 0.000001; -#define WITHIN_E(a,b) (fabs((a)-(b)) < epsilon) - // We're essentially duplicating the logic in UserToDevicePixelSnapped here. - bool shouldNotSnap = !aSnap || (WITHIN_E(mat._11,1.0) && - WITHIN_E(mat._22,1.0) && - WITHIN_E(mat._12,0.0) && - WITHIN_E(mat._21,0.0)); -#undef WITHIN_E - RefPtr pb = aTarget->CreatePathBuilder(); nsIntRegionRectIterator iter(aRegion); const nsIntRect* r; - if (shouldNotSnap) { - while ((r = iter.Next()) != nullptr) { - pb->MoveTo(Point(r->x, r->y)); - pb->LineTo(Point(r->XMost(), r->y)); - pb->LineTo(Point(r->XMost(), r->YMost())); - pb->LineTo(Point(r->x, r->YMost())); - pb->Close(); - } - } else { - while ((r = iter.Next()) != nullptr) { - Rect rect(r->x, r->y, r->width, r->height); - - rect.Round(); - pb->MoveTo(rect.TopLeft()); - pb->LineTo(rect.TopRight()); - pb->LineTo(rect.BottomRight()); - pb->LineTo(rect.BottomLeft()); - pb->Close(); - } + while ((r = iter.Next()) != nullptr) { + pb->MoveTo(Point(r->x, r->y)); + pb->LineTo(Point(r->XMost(), r->y)); + pb->LineTo(Point(r->XMost(), r->YMost())); + pb->LineTo(Point(r->x, r->YMost())); + pb->Close(); } RefPtr path = pb->Finish(); return path; } static void -ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, - bool aSnap) +ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion) { if (!aRegion.IsComplex()) { nsIntRect rect = aRegion.GetBounds(); @@ -716,7 +691,7 @@ ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, return; } - RefPtr path = PathFromRegionInternal(aTarget, aRegion, aSnap); + RefPtr path = PathFromRegionInternal(aTarget, aRegion); aTarget->PushClip(path); } @@ -729,7 +704,7 @@ gfxUtils::ClipToRegion(gfxContext* aContext, const nsIntRegion& aRegion) /*static*/ void gfxUtils::ClipToRegion(DrawTarget* aTarget, const nsIntRegion& aRegion) { - ClipToRegionInternal(aTarget, aRegion, false); + ClipToRegionInternal(aTarget, aRegion); } /*static*/ void @@ -738,12 +713,6 @@ gfxUtils::ClipToRegionSnapped(gfxContext* aContext, const nsIntRegion& aRegion) ClipToRegionInternal(aContext, aRegion, true); } -/*static*/ void -gfxUtils::ClipToRegionSnapped(DrawTarget* aTarget, const nsIntRegion& aRegion) -{ - ClipToRegionInternal(aTarget, aRegion, true); -} - /*static*/ gfxFloat gfxUtils::ClampToScaleFactor(gfxFloat aVal) { diff --git a/gfx/thebes/gfxUtils.h b/gfx/thebes/gfxUtils.h index 476ad40273e7..176435f2a8f4 100644 --- a/gfx/thebes/gfxUtils.h +++ b/gfx/thebes/gfxUtils.h @@ -99,11 +99,6 @@ public: */ static void ClipToRegionSnapped(gfxContext* aContext, const nsIntRegion& aRegion); - /** - * Clip aTarget to the region aRegion, snapping the rectangles. - */ - static void ClipToRegionSnapped(mozilla::gfx::DrawTarget* aTarget, const nsIntRegion& aRegion); - /** * Create a path consisting of rectangles in |aRegion|. */