Bug 1299438 - avoid calling multiple times isEmpty. r?longsonr
MozReview-Commit-ID: EAZtP3EveVL
--- 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);