From 3c2c9a686e25a0a42175deb08e0dee4e87380997 Mon Sep 17 00:00:00 2001 From: violet Date: Wed, 1 May 2019 17:53:32 +0000 Subject: [PATCH] Bug 608812 - Should snap subpixel value for outer svg and anon child r=longsonr We should snap subpixel value at nsDisplayTransform::GetResultingTransformMatrix for outer svg and the anon child. This will solve blurry rendering for subpixel position when webrender is __not__ enabled. Differential Revision: https://phabricator.services.mozilla.com/D29344 --HG-- extra : moz-landing-system : lando --- layout/painting/nsDisplayList.cpp | 7 ++++++- layout/reftests/w3c-css/submitted/images3/reftest.list | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 687215546ab6..017a787ceba1 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -7803,10 +7803,15 @@ Matrix4x4 nsDisplayTransform::GetResultingTransformMatrixInternal( frame && frame->IsSVGTransformed(&svgTransform, &parentsChildrenOnlyTransform); + bool shouldRound = true; + // An SVG frame should not have its translation rounded. // Note it's possible that the SVG frame doesn't have an SVG // transform but only has a CSS transform. - bool shouldRound = !(frame && frame->IsFrameOfType(nsIFrame::eSVG)); + if (frame && frame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT) && + !frame->IsSVGOuterSVGAnonChildFrame()) { + shouldRound = false; + } /* Transformed frames always have a transform, or are preserving 3d (and might * still have perspective!) */ diff --git a/layout/reftests/w3c-css/submitted/images3/reftest.list b/layout/reftests/w3c-css/submitted/images3/reftest.list index eebe5b890563..49495cfafc25 100644 --- a/layout/reftests/w3c-css/submitted/images3/reftest.list +++ b/layout/reftests/w3c-css/submitted/images3/reftest.list @@ -181,13 +181,13 @@ fails-if(!webrender) == object-position-png-002c.html object-position-png-002-re == object-position-png-002i.html object-position-png-002-ref.html == object-position-png-002o.html object-position-png-002-ref.html == object-position-png-002p.html object-position-png-002-ref.html -fails-if(!webrender) random-if(webrender) == object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 +random-if(webrender) == object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001i.html object-position-svg-001-ref.html -fails-if(!webrender) random-if(webrender) == object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 +random-if(webrender) == object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001p.html object-position-svg-001-ref.html -fails == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 +fails-if(webrender) == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002i.html object-position-svg-002-ref.html -fails == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 +fails-if(webrender) == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002p.html object-position-svg-002-ref.html # Tests for gradient color stops with 'currentcolor'