Title: [249170] trunk/Source/WebCore
Revision
249170
Author
simon.fra...@apple.com
Date
2019-08-27 14:09:47 -0700 (Tue, 27 Aug 2019)

Log Message

Minor optimization in InlineFlowBox::paintBoxDecorations()
https://bugs.webkit.org/show_bug.cgi?id=201199

Reviewed by Zalan Bujtas.

This function can early return before computing localRect, which takes a bit of time (seen
on profiles).

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (249169 => 249170)


--- trunk/Source/WebCore/ChangeLog	2019-08-27 21:03:17 UTC (rev 249169)
+++ trunk/Source/WebCore/ChangeLog	2019-08-27 21:09:47 UTC (rev 249170)
@@ -1,3 +1,16 @@
+2019-08-27  Simon Fraser  <simon.fra...@apple.com>
+
+        Minor optimization in InlineFlowBox::paintBoxDecorations()
+        https://bugs.webkit.org/show_bug.cgi?id=201199
+
+        Reviewed by Zalan Bujtas.
+
+        This function can early return before computing localRect, which takes a bit of time (seen
+        on profiles).
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+
 2019-08-27  Carlos Alberto Lopez Perez  <clo...@igalia.com>
 
         Drawing an animated image to a canvas via drawImage should draw the first frame

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (249169 => 249170)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2019-08-27 21:03:17 UTC (rev 249169)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2019-08-27 21:09:47 UTC (rev 249170)
@@ -1347,13 +1347,6 @@
     if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || paintInfo.phase != PaintPhase::Foreground)
         return;
 
-    LayoutRect frameRect(this->frameRect());
-    constrainToLineTopAndBottomIfNeeded(frameRect);
-    
-    // Move x/y to our coordinates.
-    LayoutRect localRect(frameRect);
-    flipForWritingMode(localRect);
-
     // You can use p::first-line to specify a background. If so, the root line boxes for
     // a line may actually have to paint a background.
     if (parent() && !renderer().hasVisibleBoxDecorations())
@@ -1362,6 +1355,13 @@
     if (!parent() && (!isFirstLine() || &lineStyle == &renderer().style()))
         return;
 
+    LayoutRect frameRect(this->frameRect());
+    constrainToLineTopAndBottomIfNeeded(frameRect);
+    
+    // Move x/y to our coordinates.
+    LayoutRect localRect(frameRect);
+    flipForWritingMode(localRect);
+
     LayoutPoint adjustedPaintoffset = paintOffset + localRect.location();
     GraphicsContext& context = paintInfo.context();
     LayoutRect paintRect = LayoutRect(adjustedPaintoffset, frameRect.size());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to