Skip to content
Permalink
Browse files
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
heycam committed Jun 22, 2022
1 parent ec2deb8 commit 4b7ee112161d46e2667accc83cb24919538a82b9
Showing 1 changed file with 6 additions and 2 deletions.
@@ -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 @@ DecomposedGlyphs::DecomposedGlyphs(PositionedGlyphs&& positionedGlyphs, const Fl
ASSERT(m_positionedGlyphs.glyphs.size() == m_positionedGlyphs.advances.size());
}

DecomposedGlyphs::~DecomposedGlyphs()
{
for (auto observer : m_observers)
observer->releaseDecomposedGlyphs(m_renderingResourceIdentifier);
}

} // namespace WebCore

0 comments on commit 4b7ee11

Please sign in to comment.