Title: [295706] trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp
Revision
295706
Author
[email protected]
Date
2022-06-21 17:39:46 -0700 (Tue, 21 Jun 2022)

Log Message

DecomposedGlyphs should notify observers in destructor
https://bugs.webkit.org/show_bug.cgi?id=241752

Reviewed by Simon Fraser.

Currently old DecomposedGlyphs objects will hang around in the GPU process until
the document goes away, instead of (as is intended) when the display list they
are in is removed from the GlyphDisplayListCache.

* Source/WebCore/platform/graphics/DecomposedGlyphs.cpp:
(WebCore::DecomposedGlyphs::~DecomposedGlyphs):

Canonical link: https://commits.webkit.org/251711@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp (295705 => 295706)


--- trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp	2022-06-22 00:17:21 UTC (rev 295705)
+++ trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp	2022-06-22 00:39:46 UTC (rev 295706)
@@ -28,8 +28,6 @@
 
 namespace WebCore {
 
-DecomposedGlyphs::~DecomposedGlyphs() = default;
-
 Ref<DecomposedGlyphs> DecomposedGlyphs::create(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode mode, RenderingResourceIdentifier renderingResourceIdentifier)
 {
     return adoptRef(*new DecomposedGlyphs(font, glyphs, advances, count, localAnchor, mode, renderingResourceIdentifier));
@@ -55,4 +53,10 @@
     ASSERT(m_positionedGlyphs.glyphs.size() == m_positionedGlyphs.advances.size());
 }
 
+DecomposedGlyphs::~DecomposedGlyphs()
+{
+    for (auto observer : m_observers)
+        observer->releaseDecomposedGlyphs(m_renderingResourceIdentifier);
+}
+
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to