[webkit-changes] [WebKit/WebKit] aad136: Heap-allocate Font::m_glyphPathMap

Simon Fraser noreply at github.com
Mon Feb 6 20:03:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aad1367818261835e2339826089134937752e81d
      https://github.com/WebKit/WebKit/commit/aad1367818261835e2339826089134937752e81d
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/Font.cpp
    M Source/WebCore/platform/graphics/Font.h

  Log Message:
  -----------
  Heap-allocate Font::m_glyphPathMap
https://bugs.webkit.org/show_bug.cgi?id=251814
rdar://105098022

Reviewed by Myles C. Maxfield.

GlyphMetricsMap<std::optional<Path>>> is 896 bytes and rarely used so heap-allocate it, reducing Font from 1256
to 352 bytes.

Also change the return value of Font::pathForGlyph to a Path reference, since this eliminates the need for
the scary comments, and the only caller copies anyway.

* Source/WebCore/platform/graphics/Font.cpp:
(WebCore::Font::pathForGlyph const):
* Source/WebCore/platform/graphics/Font.h:

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




More information about the webkit-changes mailing list