WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
148965
Split mixed font GlyphPage functionality to separate class
https://bugs.webkit.org/show_bug.cgi?id=148965
Summary
Split mixed font GlyphPage functionality to separate class
Antti Koivisto
Reported
2015-09-08 10:19:13 PDT
Currently GlyphPage class is used for both immutable single font case (in Font) and for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate classed for these cases. This will also make future improvements easier.
Attachments
patch
(28.43 KB, patch)
2015-09-08 11:59 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(28.82 KB, patch)
2015-09-08 12:46 PDT
,
Antti Koivisto
mmaxfield
: review+
Details
Formatted Diff
Diff
patch
(30.51 KB, patch)
2015-09-09 04:41 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2015-09-08 11:59:28 PDT
Created
attachment 260779
[details]
patch
Antti Koivisto
Comment 2
2015-09-08 12:46:36 PDT
Created
attachment 260783
[details]
patch
Myles C. Maxfield
Comment 3
2015-09-08 14:47:36 PDT
Comment on
attachment 260783
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=260783&action=review
I think this is fine.
> Source/WebCore/platform/graphics/FontCascadeFonts.cpp:56 > +void FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage(RefPtr<GlyphPage>&& page)
Shouldn't this take a Ref?
> Source/WebCore/platform/graphics/FontCascadeFonts.h:98 > + RefPtr<GlyphPage> m_singleFont; > + std::unique_ptr<MixedFontGlyphPage> m_mixedFont;
Unclear why one is a RefPtr and the other one is a unique_ptr.
> Source/WebCore/platform/graphics/GlyphPage.h:74 > static unsigned indexForCharacter(UChar32 c) { return c % GlyphPage::size; }
Shouldn't this be private (maybe with a friend of MixedFontGlyphPage?) Seems to me that external people don't need to know this.
> Source/WebCore/platform/graphics/GlyphPage.h:83 > + return m_glyphs[indexForCharacter(c)];
Please add ASSERT_WITH_SECURITY_IMPLICATION() in all member functions which deal with this stuff
> Source/WebCore/platform/graphics/GlyphPage.h:94 > + void setGlyphDataForIndex(unsigned index, Glyph glyph)
Looks to me like this function is just setting the glyph, not the GlyphData. Now that you are separating mixed parts from the non-mixed parts, I think it makes sense to give them different APIs.
> Source/WebCore/platform/graphics/GlyphPage.h:121 > +class MixedFontGlyphPage {
Seems to me that this should get its own file.
> Source/WebCore/platform/graphics/GlyphPage.h:124 > + MixedFontGlyphPage(RefPtr<GlyphPage>&& initialPage)
Judging from the function body, shouldn't this take a regular lvalue reference instead of an rvalue reference?
Antti Koivisto
Comment 4
2015-09-09 04:41:48 PDT
Created
attachment 260857
[details]
patch
Antti Koivisto
Comment 5
2015-09-09 04:43:36 PDT
> Unclear why one is a RefPtr and the other one is a unique_ptr.
One is shared, other is not.
>> +class MixedFontGlyphPage { > Seems to me that this should get its own file.
I moved it to FontCascadeFonts.cpp since it is really an implementation detail of that type.
Antti Koivisto
Comment 6
2015-09-09 06:01:38 PDT
https://trac.webkit.org/r189539
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug