<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[269556] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/269556">269556</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2020-11-06 19:53:43 -0800 (Fri, 06 Nov 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove `localBounds` and `globalBounds` methods from display list items that are not drawing items
https://bugs.webkit.org/show_bug.cgi?id=218675

Reviewed by Tim Horton and Devin Rousso.

In <a href="http://trac.webkit.org/projects/webkit/changeset/269525">r269525</a>, I refactored display list items to no longer derive from base classes (i.e. `DisplayList::Item` and
`DisplayList::DrawingItem`). In doing so, I ended up adding the `localBounds` and `globalBounds` methods
everywhere, since these methods are called from within the templated `DisplayList::Recorder::append` method
if the given type is a drawing item (that is, the static `isDrawingItem` flag is set).

However, for non-drawing items such as state change items, `FlushContext`, and `MetaCommandSwitchTo`, having
these methods makes no sense. We can fix this by leveraging `constexpr if` to only update item extents for
display list item types that are drawing items.

This allows us to remove these two methods from all display list items that are not drawing items.

* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::Save::localBounds const): Deleted.
(WebCore::DisplayList::Save::globalBounds const): Deleted.
(WebCore::DisplayList::Restore::localBounds const): Deleted.
(WebCore::DisplayList::Restore::globalBounds const): Deleted.
(WebCore::DisplayList::Translate::localBounds const): Deleted.
(WebCore::DisplayList::Translate::globalBounds const): Deleted.
(WebCore::DisplayList::Rotate::localBounds const): Deleted.
(WebCore::DisplayList::Rotate::globalBounds const): Deleted.
(WebCore::DisplayList::Scale::localBounds const): Deleted.
(WebCore::DisplayList::Scale::globalBounds const): Deleted.
(WebCore::DisplayList::SetCTM::localBounds const): Deleted.
(WebCore::DisplayList::SetCTM::globalBounds const): Deleted.
(WebCore::DisplayList::ConcatenateCTM::localBounds const): Deleted.
(WebCore::DisplayList::ConcatenateCTM::globalBounds const): Deleted.
(WebCore::DisplayList::SetInlineFillGradient::localBounds const): Deleted.
(WebCore::DisplayList::SetInlineFillGradient::globalBounds const): Deleted.
(WebCore::DisplayList::SetInlineFillColor::localBounds const): Deleted.
(WebCore::DisplayList::SetInlineFillColor::globalBounds const): Deleted.
(WebCore::DisplayList::SetInlineStrokeColor::localBounds const): Deleted.
(WebCore::DisplayList::SetInlineStrokeColor::globalBounds const): Deleted.
(WebCore::DisplayList::SetStrokeThickness::localBounds const): Deleted.
(WebCore::DisplayList::SetStrokeThickness::globalBounds const): Deleted.
(WebCore::DisplayList::SetState::localBounds const): Deleted.
(WebCore::DisplayList::SetState::globalBounds const): Deleted.
(WebCore::DisplayList::SetLineCap::localBounds const): Deleted.
(WebCore::DisplayList::SetLineCap::globalBounds const): Deleted.
(WebCore::DisplayList::SetLineDash::localBounds const): Deleted.
(WebCore::DisplayList::SetLineDash::globalBounds const): Deleted.
(WebCore::DisplayList::SetLineJoin::localBounds const): Deleted.
(WebCore::DisplayList::SetLineJoin::globalBounds const): Deleted.
(WebCore::DisplayList::SetMiterLimit::localBounds const): Deleted.
(WebCore::DisplayList::SetMiterLimit::globalBounds const): Deleted.
(WebCore::DisplayList::ClearShadow::localBounds const): Deleted.
(WebCore::DisplayList::ClearShadow::globalBounds const): Deleted.
(WebCore::DisplayList::Clip::localBounds const): Deleted.
(WebCore::DisplayList::Clip::globalBounds const): Deleted.
(WebCore::DisplayList::ClipOut::localBounds const): Deleted.
(WebCore::DisplayList::ClipOut::globalBounds const): Deleted.
(WebCore::DisplayList::ClipOutToPath::localBounds const): Deleted.
(WebCore::DisplayList::ClipOutToPath::globalBounds const): Deleted.
(WebCore::DisplayList::ClipPath::localBounds const): Deleted.
(WebCore::DisplayList::ClipPath::globalBounds const): Deleted.
(WebCore::DisplayList::ClipToDrawingCommands::localBounds const): Deleted.
(WebCore::DisplayList::ClipToDrawingCommands::globalBounds const): Deleted.
(WebCore::DisplayList::ApplyStrokePattern::localBounds const): Deleted.
(WebCore::DisplayList::ApplyStrokePattern::globalBounds const): Deleted.
(WebCore::DisplayList::ApplyFillPattern::localBounds const): Deleted.
(WebCore::DisplayList::ApplyFillPattern::globalBounds const): Deleted.
(WebCore::DisplayList::ApplyDeviceScaleFactor::localBounds const): Deleted.
(WebCore::DisplayList::ApplyDeviceScaleFactor::globalBounds const): Deleted.
(WebCore::DisplayList::FlushContext::localBounds const): Deleted.
(WebCore::DisplayList::FlushContext::globalBounds const): Deleted.
(WebCore::DisplayList::MetaCommandSwitchTo::localBounds const): Deleted.
(WebCore::DisplayList::MetaCommandSwitchTo::globalBounds const): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::appendWithoutUpdatingExtents):
(WebCore::DisplayList::Recorder::append):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemsh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (269555 => 269556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-11-07 02:09:02 UTC (rev 269555)
+++ trunk/Source/WebCore/ChangeLog      2020-11-07 03:53:43 UTC (rev 269556)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2020-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Remove `localBounds` and `globalBounds` methods from display list items that are not drawing items
+        https://bugs.webkit.org/show_bug.cgi?id=218675
+
+        Reviewed by Tim Horton and Devin Rousso.
+
+        In r269525, I refactored display list items to no longer derive from base classes (i.e. `DisplayList::Item` and
+        `DisplayList::DrawingItem`). In doing so, I ended up adding the `localBounds` and `globalBounds` methods
+        everywhere, since these methods are called from within the templated `DisplayList::Recorder::append` method
+        if the given type is a drawing item (that is, the static `isDrawingItem` flag is set).
+
+        However, for non-drawing items such as state change items, `FlushContext`, and `MetaCommandSwitchTo`, having
+        these methods makes no sense. We can fix this by leveraging `constexpr if` to only update item extents for
+        display list item types that are drawing items.
+
+        This allows us to remove these two methods from all display list items that are not drawing items.
+
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::Save::localBounds const): Deleted.
+        (WebCore::DisplayList::Save::globalBounds const): Deleted.
+        (WebCore::DisplayList::Restore::localBounds const): Deleted.
+        (WebCore::DisplayList::Restore::globalBounds const): Deleted.
+        (WebCore::DisplayList::Translate::localBounds const): Deleted.
+        (WebCore::DisplayList::Translate::globalBounds const): Deleted.
+        (WebCore::DisplayList::Rotate::localBounds const): Deleted.
+        (WebCore::DisplayList::Rotate::globalBounds const): Deleted.
+        (WebCore::DisplayList::Scale::localBounds const): Deleted.
+        (WebCore::DisplayList::Scale::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetCTM::localBounds const): Deleted.
+        (WebCore::DisplayList::SetCTM::globalBounds const): Deleted.
+        (WebCore::DisplayList::ConcatenateCTM::localBounds const): Deleted.
+        (WebCore::DisplayList::ConcatenateCTM::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineFillGradient::localBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineFillGradient::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineFillColor::localBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineFillColor::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineStrokeColor::localBounds const): Deleted.
+        (WebCore::DisplayList::SetInlineStrokeColor::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetStrokeThickness::localBounds const): Deleted.
+        (WebCore::DisplayList::SetStrokeThickness::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetState::localBounds const): Deleted.
+        (WebCore::DisplayList::SetState::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetLineCap::localBounds const): Deleted.
+        (WebCore::DisplayList::SetLineCap::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetLineDash::localBounds const): Deleted.
+        (WebCore::DisplayList::SetLineDash::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetLineJoin::localBounds const): Deleted.
+        (WebCore::DisplayList::SetLineJoin::globalBounds const): Deleted.
+        (WebCore::DisplayList::SetMiterLimit::localBounds const): Deleted.
+        (WebCore::DisplayList::SetMiterLimit::globalBounds const): Deleted.
+        (WebCore::DisplayList::ClearShadow::localBounds const): Deleted.
+        (WebCore::DisplayList::ClearShadow::globalBounds const): Deleted.
+        (WebCore::DisplayList::Clip::localBounds const): Deleted.
+        (WebCore::DisplayList::Clip::globalBounds const): Deleted.
+        (WebCore::DisplayList::ClipOut::localBounds const): Deleted.
+        (WebCore::DisplayList::ClipOut::globalBounds const): Deleted.
+        (WebCore::DisplayList::ClipOutToPath::localBounds const): Deleted.
+        (WebCore::DisplayList::ClipOutToPath::globalBounds const): Deleted.
+        (WebCore::DisplayList::ClipPath::localBounds const): Deleted.
+        (WebCore::DisplayList::ClipPath::globalBounds const): Deleted.
+        (WebCore::DisplayList::ClipToDrawingCommands::localBounds const): Deleted.
+        (WebCore::DisplayList::ClipToDrawingCommands::globalBounds const): Deleted.
+        (WebCore::DisplayList::ApplyStrokePattern::localBounds const): Deleted.
+        (WebCore::DisplayList::ApplyStrokePattern::globalBounds const): Deleted.
+        (WebCore::DisplayList::ApplyFillPattern::localBounds const): Deleted.
+        (WebCore::DisplayList::ApplyFillPattern::globalBounds const): Deleted.
+        (WebCore::DisplayList::ApplyDeviceScaleFactor::localBounds const): Deleted.
+        (WebCore::DisplayList::ApplyDeviceScaleFactor::globalBounds const): Deleted.
+        (WebCore::DisplayList::FlushContext::localBounds const): Deleted.
+        (WebCore::DisplayList::FlushContext::globalBounds const): Deleted.
+        (WebCore::DisplayList::MetaCommandSwitchTo::localBounds const): Deleted.
+        (WebCore::DisplayList::MetaCommandSwitchTo::globalBounds const): Deleted.
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        (WebCore::DisplayList::Recorder::appendWithoutUpdatingExtents):
+        (WebCore::DisplayList::Recorder::append):
+
</ins><span class="cx"> 2020-11-06  Andres Gonzalez  <andresg_22@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Fix for LayoutTests/accessibility/Mac/accesskey.html in isolated tree mode.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (269555 => 269556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h   2020-11-07 02:09:02 UTC (rev 269555)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h      2020-11-07 03:53:43 UTC (rev 269556)
</span><span class="lines">@@ -58,9 +58,6 @@
</span><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><del>-
-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class Restore {
</span><span class="lines">@@ -70,9 +67,6 @@
</span><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><del>-
-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class Translate {
</span><span class="lines">@@ -92,9 +86,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_x { 0 };
</span><span class="cx">     float m_y { 0 };
</span><span class="lines">@@ -115,9 +106,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_angle { 0 }; // In radians.
</span><span class="cx"> };
</span><span class="lines">@@ -137,9 +125,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     FloatSize m_size;
</span><span class="cx"> };
</span><span class="lines">@@ -159,9 +144,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     AffineTransform m_transform;
</span><span class="cx"> };
</span><span class="lines">@@ -181,9 +163,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     AffineTransform m_transform;
</span><span class="cx"> };
</span><span class="lines">@@ -204,9 +183,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_offsets[maxColorStopCount];
</span><span class="cx">     SRGBA<uint8_t> m_colors[maxColorStopCount];
</span><span class="lines">@@ -230,9 +206,6 @@
</span><span class="cx">     Color color() const { return { m_colorData }; }
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     SRGBA<uint8_t> m_colorData;
</span><span class="cx"> };
</span><span class="lines">@@ -252,9 +225,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     SRGBA<uint8_t> m_colorData;
</span><span class="cx"> };
</span><span class="lines">@@ -274,9 +244,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_thickness { 0 };
</span><span class="cx"> };
</span><span class="lines">@@ -301,9 +268,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     GraphicsContextStateChange m_state;
</span><span class="cx"> };
</span><span class="lines">@@ -638,9 +602,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     LineCap m_lineCap;
</span><span class="cx"> };
</span><span class="lines">@@ -662,9 +623,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx">     template<class Encoder> void encode(Encoder&) const;
</span><span class="cx">     template<class Decoder> static Optional<SetLineDash> decode(Decoder&);
</span><span class="cx"> 
</span><span class="lines">@@ -711,9 +669,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     LineJoin m_lineJoin;
</span><span class="cx"> };
</span><span class="lines">@@ -733,9 +688,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_miterLimit;
</span><span class="cx"> };
</span><span class="lines">@@ -747,9 +699,6 @@
</span><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><del>-
-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // FIXME: treat as drawing item?
</span><span class="lines">@@ -768,9 +717,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     FloatRect m_rect;
</span><span class="cx"> };
</span><span class="lines">@@ -790,9 +736,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     FloatRect m_rect;
</span><span class="cx"> };
</span><span class="lines">@@ -820,9 +763,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     Path m_path;
</span><span class="cx"> };
</span><span class="lines">@@ -867,9 +807,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx">     template<class Encoder> void encode(Encoder&) const;
</span><span class="cx">     template<class Decoder> static Optional<ClipPath> decode(Decoder&);
</span><span class="cx"> 
</span><span class="lines">@@ -938,9 +875,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     FloatRect m_destination;
</span><span class="cx">     ColorSpace m_colorSpace;
</span><span class="lines">@@ -2567,9 +2501,6 @@
</span><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><del>-
-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class ApplyFillPattern {
</span><span class="lines">@@ -2579,9 +2510,6 @@
</span><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><del>-
-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="lines">@@ -2601,9 +2529,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     float m_scaleFactor { 1 };
</span><span class="cx"> };
</span><span class="lines">@@ -2623,9 +2548,6 @@
</span><span class="cx"> 
</span><span class="cx">     void apply(GraphicsContext&) const;
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     FlushIdentifier m_identifier;
</span><span class="cx"> };
</span><span class="lines">@@ -2645,9 +2567,6 @@
</span><span class="cx"> 
</span><span class="cx">     ItemBufferIdentifier identifier() const { return m_identifier; }
</span><span class="cx"> 
</span><del>-    Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; }
-    Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
-
</del><span class="cx"> private:
</span><span class="cx">     ItemBufferIdentifier m_identifier;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (269555 => 269556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h        2020-11-07 02:09:02 UTC (rev 269555)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h   2020-11-07 03:53:43 UTC (rev 269556)
</span><span class="lines">@@ -153,19 +153,18 @@
</span><span class="cx">         m_displayList.append<T>(std::forward<Args>(args)...);
</span><span class="cx">         didAppendItemOfType(T::itemType);
</span><span class="cx"> 
</span><del>-        if (!T::isDrawingItem)
-            return;
</del><ins>+        if constexpr (T::isDrawingItem) {
+            if (LIKELY(!m_displayList.tracksDrawingItemExtents()))
+                return;
</ins><span class="cx"> 
</span><del>-        if (LIKELY(!m_displayList.tracksDrawingItemExtents()))
-            return;
-
-        auto item = T(std::forward<Args>(args)...);
-        if (auto rect = item.localBounds(graphicsContext()))
-            m_displayList.addDrawingItemExtent(extentFromLocalBounds(*rect));
-        else if (auto rect = item.globalBounds())
-            m_displayList.addDrawingItemExtent(*rect);
-        else
-            m_displayList.addDrawingItemExtent(WTF::nullopt);
</del><ins>+            auto item = T(std::forward<Args>(args)...);
+            if (auto rect = item.localBounds(graphicsContext()))
+                m_displayList.addDrawingItemExtent(extentFromLocalBounds(*rect));
+            else if (auto rect = item.globalBounds())
+                m_displayList.addDrawingItemExtent(*rect);
+            else
+                m_displayList.addDrawingItemExtent(WTF::nullopt);
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void willAppendItemOfType(ItemType);
</span></span></pre>
</div>
</div>

</body>
</html>