Title: [268304] trunk/Source/WebCore
Revision
268304
Author
[email protected]
Date
2020-10-09 17:41:19 -0700 (Fri, 09 Oct 2020)

Log Message

[GPU Process] Delete DisplayList::DrawGlyphs::m_blockLocation because it's always 0
https://bugs.webkit.org/show_bug.cgi?id=217541

Reviewed by Wenson Hsieh.

There's no reason for it to exist.

No new tests because there is no behavior change.

* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::DrawGlyphs):
(WebCore::DisplayList::DrawGlyphs::computeBounds):
(WebCore::DisplayList::DrawGlyphs::localBounds const):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawGlyphs::create):
(WebCore::DisplayList::DrawGlyphs::localAnchor const):
(WebCore::DisplayList::DrawGlyphs::anchorPoint const):
(WebCore::DisplayList::DrawGlyphs::encode const):
(WebCore::DisplayList::DrawGlyphs::decode):
(WebCore::DisplayList::DrawGlyphs::blockLocation const): Deleted.
(WebCore::DisplayList::DrawGlyphs::setBlockLocation): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawGlyphs):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (268303 => 268304)


--- trunk/Source/WebCore/ChangeLog	2020-10-10 00:20:59 UTC (rev 268303)
+++ trunk/Source/WebCore/ChangeLog	2020-10-10 00:41:19 UTC (rev 268304)
@@ -1,5 +1,32 @@
 2020-10-09  Myles C. Maxfield  <[email protected]>
 
+        [GPU Process] Delete DisplayList::DrawGlyphs::m_blockLocation because it's always 0
+        https://bugs.webkit.org/show_bug.cgi?id=217541
+
+        Reviewed by Wenson Hsieh.
+
+        There's no reason for it to exist.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/displaylists/DisplayListItems.cpp:
+        (WebCore::DisplayList::DrawGlyphs::DrawGlyphs):
+        (WebCore::DisplayList::DrawGlyphs::computeBounds):
+        (WebCore::DisplayList::DrawGlyphs::localBounds const):
+        (WebCore::DisplayList::operator<<):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::DrawGlyphs::create):
+        (WebCore::DisplayList::DrawGlyphs::localAnchor const):
+        (WebCore::DisplayList::DrawGlyphs::anchorPoint const):
+        (WebCore::DisplayList::DrawGlyphs::encode const):
+        (WebCore::DisplayList::DrawGlyphs::decode):
+        (WebCore::DisplayList::DrawGlyphs::blockLocation const): Deleted.
+        (WebCore::DisplayList::DrawGlyphs::setBlockLocation): Deleted.
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::drawGlyphs):
+
+2020-10-09  Myles C. Maxfield  <[email protected]>
+
         [GPU Process] Mechanical cleanup in DisplayListRecorder
         https://bugs.webkit.org/show_bug.cgi?id=217539
 

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (268303 => 268304)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2020-10-10 00:20:59 UTC (rev 268303)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2020-10-10 00:41:19 UTC (rev 268304)
@@ -542,12 +542,11 @@
     return ts;
 }
 
-DrawGlyphs::DrawGlyphs(const Font& font, Vector<GlyphBufferGlyph, 128>&& glyphs, Vector<GlyphBufferAdvance, 128>&& advances, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode smoothingMode)
+DrawGlyphs::DrawGlyphs(const Font& font, Vector<GlyphBufferGlyph, 128>&& glyphs, Vector<GlyphBufferAdvance, 128>&& advances, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
     : DrawingItem(ItemType::DrawGlyphs)
     , m_font(const_cast<Font&>(font))
     , m_glyphs(WTFMove(glyphs))
     , m_advances(WTFMove(advances))
-    , m_blockLocation(blockLocation)
     , m_localAnchor(localAnchor)
     , m_smoothingMode(smoothingMode)
 {
@@ -554,10 +553,9 @@
     computeBounds();
 }
 
-DrawGlyphs::DrawGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode smoothingMode)
+DrawGlyphs::DrawGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
     : DrawingItem(ItemType::DrawGlyphs)
     , m_font(const_cast<Font&>(font))
-    , m_blockLocation(blockLocation)
     , m_localAnchor(localAnchor)
     , m_smoothingMode(smoothingMode)
 {
@@ -591,7 +589,7 @@
     // the glyph lies entirely within its [(ascent + descent), advance] rect.
     float ascent = m_font->fontMetrics().floatAscent();
     float descent = m_font->fontMetrics().floatDescent();
-    FloatPoint current = toFloatPoint(localAnchor());
+    FloatPoint current = localAnchor();
     size_t numGlyphs = m_glyphs.size();
     for (size_t i = 0; i < numGlyphs; ++i) {
         GlyphBufferAdvance advance = m_advances[i];
@@ -604,9 +602,7 @@
 
 Optional<FloatRect> DrawGlyphs::localBounds(const GraphicsContext&) const
 {
-    FloatRect localBounds = m_bounds;
-    localBounds.move(m_blockLocation.x(), m_blockLocation.y());
-    return localBounds;
+    return m_bounds;
 }
 
 static TextStream& operator<<(TextStream& ts, const DrawGlyphs& item)
@@ -613,7 +609,6 @@
 {
     ts << static_cast<const DrawingItem&>(item);
     // FIXME: dump more stuff.
-    ts.dumpProperty("block-location", item.blockLocation());
     ts.dumpProperty("local-anchor", item.localAnchor());
     ts.dumpProperty("anchor-point", item.anchorPoint());
     ts.dumpProperty("length", item.glyphs().size());

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (268303 => 268304)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2020-10-10 00:20:59 UTC (rev 268303)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2020-10-10 00:41:19 UTC (rev 268304)
@@ -1102,25 +1102,22 @@
 
 class DrawGlyphs : public DrawingItem {
 public:
-    static Ref<DrawGlyphs> create(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode smoothingMode)
+    static Ref<DrawGlyphs> create(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
     {
-        return adoptRef(*new DrawGlyphs(font, glyphs, advances, count, blockLocation, localAnchor, smoothingMode));
+        return adoptRef(*new DrawGlyphs(font, glyphs, advances, count, localAnchor, smoothingMode));
     }
 
-    static Ref<DrawGlyphs> create(const Font& font, Vector<GlyphBufferGlyph, 128>&& glyphs, Vector<GlyphBufferAdvance, 128>&& advances, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode smoothingMode)
+    static Ref<DrawGlyphs> create(const Font& font, Vector<GlyphBufferGlyph, 128>&& glyphs, Vector<GlyphBufferAdvance, 128>&& advances, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
     {
-        return adoptRef(*new DrawGlyphs(font, WTFMove(glyphs), WTFMove(advances), blockLocation, localAnchor, smoothingMode));
+        return adoptRef(*new DrawGlyphs(font, WTFMove(glyphs), WTFMove(advances), localAnchor, smoothingMode));
     }
 
     WEBCORE_EXPORT virtual ~DrawGlyphs();
 
-    const FloatPoint& blockLocation() const { return m_blockLocation; }
-    void setBlockLocation(const FloatPoint& blockLocation) { m_blockLocation = blockLocation; }
+    const FloatPoint& localAnchor() const { return m_localAnchor; }
 
-    const FloatSize& localAnchor() const { return m_localAnchor; }
+    FloatPoint anchorPoint() const { return m_localAnchor; }
 
-    FloatPoint anchorPoint() const { return m_blockLocation + m_localAnchor; }
-
     const Vector<GlyphBufferGlyph, 128>& glyphs() const { return m_glyphs; }
 
     template<class Encoder> void encode(Encoder&) const;
@@ -1127,8 +1124,8 @@
     template<class Decoder> static Optional<Ref<DrawGlyphs>> decode(Decoder&);
 
 private:
-    DrawGlyphs(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned count, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode);
-    WEBCORE_EXPORT DrawGlyphs(const Font&, Vector<GlyphBufferGlyph, 128>&&, Vector<GlyphBufferAdvance, 128>&&, const FloatPoint& blockLocation, const FloatSize& localAnchor, FontSmoothingMode);
+    DrawGlyphs(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode);
+    WEBCORE_EXPORT DrawGlyphs(const Font&, Vector<GlyphBufferGlyph, 128>&&, Vector<GlyphBufferAdvance, 128>&&, const FloatPoint& localAnchor, FontSmoothingMode);
 
     void computeBounds();
 
@@ -1142,8 +1139,7 @@
     Vector<GlyphBufferGlyph, 128> m_glyphs;
     Vector<GlyphBufferAdvance, 128> m_advances;
     FloatRect m_bounds;
-    FloatPoint m_blockLocation;
-    FloatSize m_localAnchor;
+    FloatPoint m_localAnchor;
     FontSmoothingMode m_smoothingMode;
 };
 
@@ -1153,7 +1149,6 @@
     encoder << m_font;
     encoder << m_glyphs;
     encoder << m_advances;
-    encoder << m_blockLocation;
     encoder << m_localAnchor;
     encoder << m_smoothingMode;
 }
@@ -1179,12 +1174,7 @@
     if (glyphs->size() != advances->size())
         return WTF::nullopt;
 
-    Optional<FloatPoint> blockLocation;
-    decoder >> blockLocation;
-    if (!blockLocation)
-        return WTF::nullopt;
-
-    Optional<FloatSize> localAnchor;
+    Optional<FloatPoint> localAnchor;
     decoder >> localAnchor;
     if (!localAnchor)
         return WTF::nullopt;
@@ -1194,7 +1184,7 @@
     if (!smoothingMode)
         return WTF::nullopt;
 
-    return DrawGlyphs::create(font->get(), WTFMove(*glyphs), WTFMove(*advances), *blockLocation, *localAnchor, *smoothingMode);
+    return DrawGlyphs::create(font->get(), WTFMove(*glyphs), WTFMove(*advances), *localAnchor, *smoothingMode);
 }
 
 class DrawImage : public DrawingItem {

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (268303 => 268304)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2020-10-10 00:20:59 UTC (rev 268303)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2020-10-10 00:41:19 UTC (rev 268304)
@@ -111,7 +111,7 @@
 
 void Recorder::drawGlyphs(const Font& font, const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, const FloatPoint& startPoint, FontSmoothingMode smoothingMode)
 {
-    appendItemAndUpdateExtent(DrawGlyphs::create(font, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs, FloatPoint(), toFloatSize(startPoint), smoothingMode));
+    appendItemAndUpdateExtent(DrawGlyphs::create(font, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs, startPoint, smoothingMode));
 }
 
 ImageDrawResult Recorder::drawImage(Image& image, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& imagePaintingOptions)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to