<!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>[283273] 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/283273">283273</a></dd>
<dt>Author</dt> <dd>drousso@apple.com</dd>
<dt>Date</dt> <dd>2021-09-29 16:04:52 -0700 (Wed, 29 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allow `DrawGlyphsRecorder` to be used with any `GraphicsContext` instead of just `DisplayList::Recorder`
https://bugs.webkit.org/show_bug.cgi?id=230913

Reviewed by Myles Maxfield.

There's really nothing about `DrawGlyphsRecorder` that's specific to display lists other
than it's currently only being used by `DisplayList::Recorder`.

This patch replaces `DisplayList::Recorder` with `GraphicsContext` in `DrawGlyphsRecorder`.
It also requires that new methods be added to `GraphicsContext` that are overridden by
`DisplayList::Recorder`. This is being done to make `<attachment>` drawing work in the
GPUProcess (<https://webkit.org/b/230781>).

* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::populateInternalState):
(WebCore::DrawGlyphsRecorder::prepareInternalContext):
(WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
(WebCore::DrawGlyphsRecorder::drawGlyphs):
* platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::drawGlyphs):
* platform/graphics/win/DrawGlyphsRecorderWin.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::drawGlyphs):

* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::drawGlyphsAndCacheFont): Added.
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::state const): Added.
(WebCore::DisplayList::Recorder::drawGlyphsAndCacheFont): Renamed from `appendDrawGlyphsItemWithCachedFont`.
AFAICT it seems like the `m_state` in `GraphicsContext` has the same values (but is a
different object) as the `currentState().stateChange.m_state` in `DisplayList::Recorder`.
Many of the non-overriden methods on `GraphicsContext` (e.g. `setStrokeColor`) both modify
the `m_state` and call `updateState`, which `DisplayList::Recorder` uses to modify its
`currentState().stateChange.m_state`. As such, we should be able to expose it as an override
for the `state` "getter" so that `DrawGlyphsRecorder` is able to access the current state in
a `GraphicsContext`-subclass agnostic way.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDrawGlyphsRecorderh">trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscoretextDrawGlyphsRecorderCoreTextcpp">trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecordercpp">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsharfbuzzDrawGlyphsRecorderHarfBuzzcpp">trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinDrawGlyphsRecorderWincpp">trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/ChangeLog      2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2021-09-29  Devin Rousso  <drousso@apple.com>
+
+        Allow `DrawGlyphsRecorder` to be used with any `GraphicsContext` instead of just `DisplayList::Recorder`
+        https://bugs.webkit.org/show_bug.cgi?id=230913
+
+        Reviewed by Myles Maxfield.
+
+        There's really nothing about `DrawGlyphsRecorder` that's specific to display lists other
+        than it's currently only being used by `DisplayList::Recorder`.
+
+        This patch replaces `DisplayList::Recorder` with `GraphicsContext` in `DrawGlyphsRecorder`.
+        It also requires that new methods be added to `GraphicsContext` that are overridden by
+        `DisplayList::Recorder`. This is being done to make `<attachment>` drawing work in the
+        GPUProcess (<https://webkit.org/b/230781>).
+
+        * platform/graphics/DrawGlyphsRecorder.h:
+        * platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        (WebCore::DrawGlyphsRecorder::populateInternalState):
+        (WebCore::DrawGlyphsRecorder::prepareInternalContext):
+        (WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
+        (WebCore::DrawGlyphsRecorder::drawGlyphs):
+        * platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        (WebCore::DrawGlyphsRecorder::drawGlyphs):
+        * platform/graphics/win/DrawGlyphsRecorderWin.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        (WebCore::DrawGlyphsRecorder::drawGlyphs):
+
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContext::drawGlyphsAndCacheFont): Added.
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::state const): Added.
+        (WebCore::DisplayList::Recorder::drawGlyphsAndCacheFont): Renamed from `appendDrawGlyphsItemWithCachedFont`.
+        AFAICT it seems like the `m_state` in `GraphicsContext` has the same values (but is a
+        different object) as the `currentState().stateChange.m_state` in `DisplayList::Recorder`.
+        Many of the non-overriden methods on `GraphicsContext` (e.g. `setStrokeColor`) both modify
+        the `m_state` and call `updateState`, which `DisplayList::Recorder` uses to modify its
+        `currentState().stateChange.m_state`. As such, we should be able to expose it as an override
+        for the `state` "getter" so that `DrawGlyphsRecorder` is able to access the current state in
+        a `GraphicsContext`-subclass agnostic way.
+
</ins><span class="cx"> 2021-09-29  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Replace FileSystemHandleImpl with FileSystemStorageConnection
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDrawGlyphsRecorderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h      2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h 2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -45,10 +45,6 @@
</span><span class="cx"> class GlyphBuffer;
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> 
</span><del>-namespace DisplayList {
-class Recorder;
-}
-
</del><span class="cx"> class DrawGlyphsRecorder {
</span><span class="cx"> public:
</span><span class="cx">     enum class DrawGlyphsDeconstruction {
</span><span class="lines">@@ -55,7 +51,7 @@
</span><span class="cx">         Deconstruct,
</span><span class="cx">         DontDeconstruct
</span><span class="cx">     };
</span><del>-    explicit DrawGlyphsRecorder(DisplayList::Recorder&, DrawGlyphsDeconstruction);
</del><ins>+    explicit DrawGlyphsRecorder(GraphicsContext&, DrawGlyphsDeconstruction);
</ins><span class="cx"> 
</span><span class="cx">     void drawGlyphs(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned numGlyphs, const FloatPoint& anchorPoint, FontSmoothingMode);
</span><span class="cx"> 
</span><span class="lines">@@ -92,7 +88,7 @@
</span><span class="cx">     void updateShadow(CGStyleRef);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    DisplayList::Recorder& m_owner;
</del><ins>+    GraphicsContext& m_owner;
</ins><span class="cx">     DrawGlyphsDeconstruction m_drawGlyphsDeconstruction;
</span><span class="cx"> 
</span><span class="cx"> #if USE(CORE_TEXT) && !PLATFORM(WIN)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h    2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -353,7 +353,7 @@
</span><span class="cx">     bool useDarkAppearance() const { return m_state.useDarkAppearance; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    const GraphicsContextState& state() const { return m_state; }
</del><ins>+    virtual const GraphicsContextState& state() const { return m_state; }
</ins><span class="cx"> 
</span><span class="cx">     virtual void updateState(const GraphicsContextState&, GraphicsContextState::StateChangeFlags) = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -470,6 +470,11 @@
</span><span class="cx">     WEBCORE_EXPORT virtual void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt);
</span><span class="cx">     WEBCORE_EXPORT virtual void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady);
</span><span class="cx"> 
</span><ins>+    virtual void drawGlyphsAndCacheFont(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned numGlyphs, const FloatPoint& point, FontSmoothingMode fontSmoothingMode)
+    {
+        drawGlyphs(font, glyphs, advances, numGlyphs, point, fontSmoothingMode);
+    }
+
</ins><span class="cx">     WEBCORE_EXPORT FloatRect computeUnderlineBoundsForText(const FloatRect&, bool printing);
</span><span class="cx">     WEBCORE_EXPORT virtual void drawLineForText(const FloatRect&, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke);
</span><span class="cx">     virtual void drawLinesForText(const FloatPoint&, float thickness, const DashArray& widths, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscoretextDrawGlyphsRecorderCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp   2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp      2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -28,8 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "BitmapImage.h"
</span><span class="cx"> #include "Color.h"
</span><del>-#include "DisplayListItems.h"
-#include "DisplayListRecorder.h"
</del><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "Font.h"
</span><span class="cx"> #include "FontCascade.h"
</span><span class="lines">@@ -86,7 +84,7 @@
</span><span class="cx">     return makeUniqueRef<GraphicsContextCG>(context.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DrawGlyphsRecorder::DrawGlyphsRecorder(DisplayList::Recorder& owner, DrawGlyphsDeconstruction drawGlyphsDeconstruction)
</del><ins>+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DrawGlyphsDeconstruction drawGlyphsDeconstruction)
</ins><span class="cx">     : m_owner(owner)
</span><span class="cx">     , m_drawGlyphsDeconstruction(drawGlyphsDeconstruction)
</span><span class="cx">     , m_internalContext(createInternalContext())
</span><span class="lines">@@ -105,7 +103,7 @@
</span><span class="cx">     m_originalState.strokeStyle.gradientSpaceTransform = contextState.strokeGradientSpaceTransform;
</span><span class="cx">     m_originalState.strokeStyle.pattern = contextState.strokePattern;
</span><span class="cx"> 
</span><del>-    m_originalState.ctm = m_owner.currentState().ctm; // FIXME: Deal with base CTM.
</del><ins>+    m_originalState.ctm = m_owner.getCTM(); // FIXME: Deal with base CTM.
</ins><span class="cx"> 
</span><span class="cx">     m_originalState.shadow.offset = contextState.shadowOffset;
</span><span class="cx">     m_originalState.shadow.blur = contextState.shadowBlur;
</span><span class="lines">@@ -156,7 +154,7 @@
</span><span class="cx">     if (font.platformData().orientation() == FontOrientation::Vertical)
</span><span class="cx">         m_originalTextMatrix = computeVerticalTextMatrix(font, m_originalTextMatrix);
</span><span class="cx"> 
</span><del>-    auto& contextState = m_owner.currentState().stateChange.m_state;
</del><ins>+    auto& contextState = m_owner.state();
</ins><span class="cx">     populateInternalState(contextState);
</span><span class="cx">     populateInternalContext(contextState);
</span><span class="cx"> }
</span><span class="lines">@@ -335,7 +333,7 @@
</span><span class="cx">     updateStrokeColor(Color::createAndPreserveColorSpace(strokeColor));
</span><span class="cx">     updateShadow(CGGStateGetStyle(gstate));
</span><span class="cx"> 
</span><del>-    m_owner.appendDrawGlyphsItemWithCachedFont(*m_originalFont, glyphs, computeAdvancesFromPositions(positions, count, currentTextMatrix).data(), count, currentTextMatrix.mapPoint(positions[0]), m_smoothingMode);
</del><ins>+    m_owner.drawGlyphsAndCacheFont(*m_originalFont, glyphs, computeAdvancesFromPositions(positions, count, currentTextMatrix).data(), count, currentTextMatrix.mapPoint(positions[0]), m_smoothingMode);
</ins><span class="cx"> 
</span><span class="cx">     m_owner.concatCTM(inverseCTMFixup);
</span><span class="cx"> }
</span><span class="lines">@@ -413,7 +411,7 @@
</span><span class="cx"> void DrawGlyphsRecorder::drawGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned numGlyphs, const FloatPoint& startPoint, FontSmoothingMode smoothingMode)
</span><span class="cx"> {
</span><span class="cx">     if (m_drawGlyphsDeconstruction == DrawGlyphsDeconstruction::DontDeconstruct) {
</span><del>-        m_owner.appendDrawGlyphsItemWithCachedFont(font, glyphs, advances, numGlyphs, startPoint, smoothingMode);
</del><ins>+        m_owner.drawGlyphsAndCacheFont(font, glyphs, advances, numGlyphs, startPoint, smoothingMode);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecordercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp      2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp 2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -150,6 +150,11 @@
</span><span class="cx">     currentState().lastDrawingState = stateChanges.m_state;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const GraphicsContextState& Recorder::state() const
+{
+    return currentState().stateChange.m_state;
+}
+
</ins><span class="cx"> void Recorder::updateState(const GraphicsContextState& state, GraphicsContextState::StateChangeFlags flags)
</span><span class="cx"> {
</span><span class="cx">     currentState().stateChange.accumulate(state, flags);
</span><span class="lines">@@ -190,7 +195,7 @@
</span><span class="cx">     m_drawGlyphsRecorder.drawGlyphs(font, glyphs, advances, numGlyphs, startPoint, smoothingMode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Recorder::appendDrawGlyphsItemWithCachedFont(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
</del><ins>+void Recorder::drawGlyphsAndCacheFont(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
</ins><span class="cx"> {
</span><span class="cx">     if (m_delegate)
</span><span class="cx">         m_delegate->recordFontUse(const_cast<Font&>(font));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h        2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h   2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx">     void flushContext(FlushIdentifier identifier) { append<FlushContext>(identifier); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    friend class WebCore::DrawGlyphsRecorder;
</del><span class="cx">     Recorder(Recorder& parent, const GraphicsContextState&, const FloatRect& initialClip, const AffineTransform& initialCTM);
</span><span class="cx"> 
</span><span class="cx">     bool hasPlatformContext() const final { return false; }
</span><span class="lines">@@ -95,6 +94,8 @@
</span><span class="cx">     void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) final { ASSERT_NOT_REACHED(); }
</span><span class="cx">     void drawLineForText(const FloatRect&, bool, bool, StrokeStyle) final { ASSERT_NOT_REACHED(); }
</span><span class="cx"> 
</span><ins>+    const GraphicsContextState& state() const final;
+
</ins><span class="cx">     void updateState(const GraphicsContextState&, GraphicsContextState::StateChangeFlags) final;
</span><span class="cx"> 
</span><span class="cx">     void setLineCap(LineCap) final;
</span><span class="lines">@@ -121,9 +122,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void drawGlyphs(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned numGlyphs, const FloatPoint& anchorPoint, FontSmoothingMode) final;
</span><ins>+    void drawGlyphsAndCacheFont(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode);
</ins><span class="cx"> 
</span><del>-    void appendDrawGlyphsItemWithCachedFont(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode);
-
</del><span class="cx">     void drawImageBuffer(WebCore::ImageBuffer&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions&) final;
</span><span class="cx">     void drawNativeImage(NativeImage&, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions&) final;
</span><span class="cx">     void drawPattern(NativeImage&, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions&) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsharfbuzzDrawGlyphsRecorderHarfBuzzcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp   2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp      2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DrawGlyphsRecorder.h"
</span><span class="cx"> 
</span><del>-#include "DisplayListItems.h"
-#include "DisplayListRecorder.h"
</del><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "Font.h"
</span><span class="cx"> #include "GlyphBuffer.h"
</span><span class="lines">@@ -34,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DrawGlyphsRecorder::DrawGlyphsRecorder(DisplayList::Recorder& owner, DrawGlyphsDeconstruction)
</del><ins>+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DrawGlyphsDeconstruction)
</ins><span class="cx">     : m_owner(owner)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -41,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DrawGlyphsRecorder::drawGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned numGlyphs, const FloatPoint& startPoint, FontSmoothingMode smoothingMode)
</span><span class="cx"> {
</span><del>-    m_owner.appendDrawGlyphsItemWithCachedFont(font, glyphs, advances, numGlyphs, startPoint, smoothingMode);
</del><ins>+    m_owner.drawGlyphsAndCacheFont(font, glyphs, advances, numGlyphs, startPoint, smoothingMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinDrawGlyphsRecorderWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp (283272 => 283273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp     2021-09-29 23:02:43 UTC (rev 283272)
+++ trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp        2021-09-29 23:04:52 UTC (rev 283273)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DrawGlyphsRecorder.h"
</span><span class="cx"> 
</span><del>-#include "DisplayListItems.h"
-#include "DisplayListRecorder.h"
</del><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "Font.h"
</span><span class="cx"> #include "GlyphBuffer.h"
</span><span class="lines">@@ -34,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DrawGlyphsRecorder::DrawGlyphsRecorder(DisplayList::Recorder& owner, DrawGlyphsDeconstruction)
</del><ins>+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DrawGlyphsDeconstruction)
</ins><span class="cx">     : m_owner(owner)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -41,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DrawGlyphsRecorder::drawGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned numGlyphs, const FloatPoint& startPoint, FontSmoothingMode smoothingMode)
</span><span class="cx"> {
</span><del>-    m_owner.appendDrawGlyphsItemWithCachedFont(font, glyphs, advances, numGlyphs, startPoint, m_smoothingMode);
</del><ins>+    m_owner.drawGlyphsAndCacheFont(font, glyphs, advances, numGlyphs, startPoint, m_smoothingMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>