WebKit Bugzilla
Attachment 359259 Details for
Bug 193485
: [FreeType] Cache the zero-width space glyph in GlyphPage::fill()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193485-20190116091920.patch (text/plain), 2.55 KB, created by
Zan Dobersek
on 2019-01-16 00:19:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2019-01-16 00:19:22 PST
Size:
2.55 KB
patch
obsolete
>Subversion Revision: 240032 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d6adce9fbf75a41b2f62b65f3a293c916ec82cbb..3064a362383ce549ca0128ab7dca62d9de21ee08 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-16 Zan Dobersek <zdobersek@igalia.com> >+ >+ [FreeType] Cache the zero-width space glyph in GlyphPage::fill() >+ https://bugs.webkit.org/show_bug.cgi?id=193485 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In FreeType's implementation of GlyphPage::fill(), we can cache the >+ zero-width space glyph upon first retrieval through the >+ FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls >+ for other ignorable characters. >+ >+ * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp: >+ (WebCore::GlyphPage::fill): >+ > 2019-01-15 Fujii Hironori <Hironori.Fujii@sony.com> > > Unreviewed WinCairo build fix. >diff --git a/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp b/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp >index dcdd26ded5061bb22e4da04e89273169b59c43d7..7c01975ed29abb466deddf238a59072929661c9e 100644 >--- a/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp >@@ -38,6 +38,7 @@ > #include <cairo-ft.h> > #include <cairo.h> > #include <fontconfig/fcfreetype.h> >+#include <wtf/Optional.h> > > namespace WebCore { > >@@ -52,6 +53,14 @@ bool GlyphPage::fill(UChar* buffer, unsigned bufferLength) > if (!face) > return false; > >+ WTF::Optional<Glyph> zeroWidthSpaceGlyphValue; >+ auto zeroWidthSpaceGlyph = >+ [&] { >+ if (!zeroWidthSpaceGlyphValue) >+ zeroWidthSpaceGlyphValue = FcFreeTypeCharIndex(face, zeroWidthSpace); >+ return *zeroWidthSpaceGlyphValue; >+ }; >+ > bool haveGlyphs = false; > UTF16UChar32Iterator iterator(buffer, bufferLength); > for (unsigned i = 0; i < GlyphPage::size; i++) { >@@ -62,7 +71,7 @@ bool GlyphPage::fill(UChar* buffer, unsigned bufferLength) > Glyph glyph = FcFreeTypeCharIndex(face, FontCascade::treatAsSpace(character) ? space : character); > // If the font doesn't support a Default_Ignorable character, replace it with zero with space. > if (!glyph && u_hasBinaryProperty(character, UCHAR_DEFAULT_IGNORABLE_CODE_POINT)) >- glyph = FcFreeTypeCharIndex(face, zeroWidthSpace); >+ glyph = zeroWidthSpaceGlyph(); > > if (!glyph) > setGlyphForIndex(i, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193485
: 359259