Bug 1299438 - avoid calling multiple times isEmpty. r=longsonr
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 31 Aug 2016 15:43:55 +0300
changeset 353360 f01400430d4997724162564efcdb4f45e0cdca27
parent 353359 58a5ab186197a0c9ecbbace0637622df0cdade7a
child 353361 53648698037586ee855b16ba6187d904cc6817cd
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs1299438
milestone51.0a1
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
Bug 1299438 - avoid calling multiple times isEmpty. r=longsonr MozReview-Commit-ID: EAZtP3EveVL
layout/svg/SVGTextFrame.cpp
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -5616,20 +5616,19 @@ SVGTextFrame::TransformFrameRectFromText
       AppUnitsToFloatCSSPixels(gfxRect(rectInTextFrame.x,
                                        rectInTextFrame.y,
                                        rectInTextFrame.width,
                                        rectInTextFrame.height), presContext);
 
     // Intersect it with the run.
     uint32_t flags = TextRenderedRun::eIncludeFill |
                      TextRenderedRun::eIncludeStroke;
-    rectInFrameUserSpace.IntersectRect
-      (rectInFrameUserSpace, run.GetFrameUserSpaceRect(presContext, flags).ToThebesRect());
-
-    if (!rectInFrameUserSpace.IsEmpty()) {
+
+    if (rectInFrameUserSpace.IntersectRect(rectInFrameUserSpace,
+        run.GetFrameUserSpaceRect(presContext, flags).ToThebesRect())) {
       // Transform it up to user space of the <text>, also taking into
       // account the font size scale.
       gfxMatrix m = run.GetTransformFromRunUserSpaceToUserSpace(presContext);
       m.Scale(mFontSizeScaleFactor, mFontSizeScaleFactor);
       gfxRect rectInUserSpace = m.Transform(rectInFrameUserSpace);
 
       // Union it into the result.
       result.UnionRect(result, rectInUserSpace);