WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
221744
[GPU Process] Temporarily disable drawing OT-SVG glyphs in the GPU process until it can be implemented properly
https://bugs.webkit.org/show_bug.cgi?id=221744
Summary
[GPU Process] Temporarily disable drawing OT-SVG glyphs in the GPU process un...
Myles C. Maxfield
Reported
2021-02-10 22:41:59 PST
[GPU Process] Temporarily disable drawing OT-SVG glyphs into canvas until it can be implemented properly
Attachments
WIP
(37.19 KB, patch)
2021-02-10 22:43 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
WIP
(9.21 KB, patch)
2021-02-11 13:37 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(14.39 KB, patch)
2021-02-12 08:19 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(14.39 KB, patch)
2021-02-12 08:48 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(14.55 KB, patch)
2021-02-12 09:36 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(14.56 KB, patch)
2021-02-12 16:42 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(23.46 KB, patch)
2021-02-12 22:29 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(23.58 KB, patch)
2021-02-12 22:51 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(23.67 KB, patch)
2021-02-13 20:59 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(23.82 KB, patch)
2021-02-14 13:51 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(23.82 KB, patch)
2021-02-14 14:17 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(24.40 KB, patch)
2021-02-14 17:18 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(23.62 KB, patch)
2021-02-14 17:20 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(23.69 KB, patch)
2021-02-14 17:21 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(24.97 KB, patch)
2021-02-15 12:32 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(24.97 KB, patch)
2021-02-15 13:27 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(26.32 KB, patch)
2021-02-15 17:21 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(25.50 KB, patch)
2021-02-15 17:22 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(52.63 KB, patch)
2021-02-15 20:23 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(52.74 KB, patch)
2021-02-15 23:20 PST
,
Myles C. Maxfield
simon.fraser
: review+
Details
Formatted Diff
Diff
Patch for committing
(52.73 KB, patch)
2021-02-16 20:13 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch for committing
(52.73 KB, patch)
2021-02-17 23:18 PST
,
Myles C. Maxfield
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(20)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2021-02-10 22:43:57 PST
Created
attachment 419948
[details]
WIP
Radar WebKit Bug Importer
Comment 2
2021-02-10 22:44:19 PST
<
rdar://problem/74222334
>
Myles C. Maxfield
Comment 3
2021-02-10 22:46:48 PST
To-do: 1. Figure out how to make it build on non-internal OSes 2. Add ASSERT_WITH_SECURITY_IMPLICATION()s to make sure the GPUP doesn't parse OT-SVG content 3. Split this patch into two: one for the refactoring, and one for the actual change We probably don't want to add any tests, because we don't want to guarantee that OT-SVG doesn't work... Instead, we would just temporarily disable any existing tests we have that make sure that drawing OT-SVG into canvas *does* work.
Myles C. Maxfield
Comment 4
2021-02-11 13:37:56 PST
Created
attachment 420036
[details]
WIP
Myles C. Maxfield
Comment 5
2021-02-11 14:45:14 PST
isInGPUProcess()
Myles C. Maxfield
Comment 6
2021-02-11 14:45:34 PST
and RELEASE_ASSERT() is better to use here than ASSERT_WITH_SECURITY_IMPLICATION().
Myles C. Maxfield
Comment 7
2021-02-12 08:19:47 PST
Created
attachment 420126
[details]
Patch
Myles C. Maxfield
Comment 8
2021-02-12 08:48:27 PST
Created
attachment 420128
[details]
Patch
Myles C. Maxfield
Comment 9
2021-02-12 09:36:57 PST
Created
attachment 420137
[details]
Patch
Myles C. Maxfield
Comment 10
2021-02-12 16:42:47 PST
Created
attachment 420193
[details]
Patch
Myles C. Maxfield
Comment 11
2021-02-12 22:29:34 PST
Created
attachment 420211
[details]
Patch
Myles C. Maxfield
Comment 12
2021-02-12 22:51:46 PST
Created
attachment 420213
[details]
Patch
Myles C. Maxfield
Comment 13
2021-02-13 20:59:03 PST
Created
attachment 420234
[details]
Patch
Myles C. Maxfield
Comment 14
2021-02-14 13:51:31 PST
Created
attachment 420251
[details]
Patch
Myles C. Maxfield
Comment 15
2021-02-14 14:17:24 PST
Created
attachment 420254
[details]
Patch
Myles C. Maxfield
Comment 16
2021-02-14 17:18:43 PST
Created
attachment 420262
[details]
Patch
Myles C. Maxfield
Comment 17
2021-02-14 17:20:11 PST
Created
attachment 420263
[details]
Patch
Myles C. Maxfield
Comment 18
2021-02-14 17:21:30 PST
Created
attachment 420264
[details]
Patch
Simon Fraser (smfr)
Comment 19
2021-02-15 09:47:04 PST
Comment on
attachment 420264
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=420264&action=review
Presumably this will cause some new test failures in the GPUProcess bot?
> Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:197 > + for (unsigned i = 0; i < numGlyphs; ++i) > + RELEASE_ASSERT(!font.glyphIsRenderedWithOTSVG(glyphs[i]));
Wouldn't it be much more efficient to pass an array of glyphs to glyphIsRenderedWithOTSV()? This is also adding an extra traversal of the glyph array even in release builds.
Myles C. Maxfield
Comment 20
2021-02-15 12:32:31 PST
Created
attachment 420348
[details]
Patch
Myles C. Maxfield
Comment 21
2021-02-15 13:27:17 PST
Created
attachment 420359
[details]
Patch
Myles C. Maxfield
Comment 22
2021-02-15 17:21:33 PST
Created
attachment 420399
[details]
Patch
Myles C. Maxfield
Comment 23
2021-02-15 17:22:57 PST
Created
attachment 420401
[details]
Patch
Myles C. Maxfield
Comment 24
2021-02-15 20:23:29 PST
Created
attachment 420421
[details]
Patch
Myles C. Maxfield
Comment 25
2021-02-15 23:20:43 PST
Created
attachment 420426
[details]
Patch
Simon Fraser (smfr)
Comment 26
2021-02-16 19:48:53 PST
Comment on
attachment 420426
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=420426&action=review
> Source/WebCore/PAL/pal/cf/OTSVGTable.cpp:34 > +OTSVGTable::OTSVGTable() > +{ > +}
= default
> Source/WebCore/PAL/pal/cf/OTSVGTable.cpp:44 > + other.table = nullptr;
isn't this what std::exchange is for?
> Source/WebCore/PAL/pal/cf/OTSVGTable.cpp:58 > + table = other.table; > + other.table = nullptr;
std::exchange (or std::swap I forget)
> Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:785 > + m_otSVGTable = PAL::OTSVGTable();
= { }?
> Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:793 > + if (PAL::softLinkOTSVGOTSVGTableGetDocumentIndexForGlyph(m_otSVGTable.value().table, glyphs[i]) != kCFNotFound) {
Is there any perf hit for calling softLinkOTSVGOTSVGTableGetDocumentIndexForGlyph every time inside the loop?
> Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp:376 > +struct GlyphsAndAdvancesStorage { > + Vector<GlyphBufferGlyph> glyphs; > + Vector<GlyphBufferAdvance> advances; > +}; > +struct GlyphsAndAdvances { > + const GlyphBufferGlyph* glyphs; > + const GlyphBufferAdvance* advances; > + unsigned numGlyphs; > + GlyphBufferAdvance initialAdvance; > + Optional<GlyphsAndAdvancesStorage> storage; > +}; > +static GlyphsAndAdvances filterOutOTSVGGlyphs(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned numGlyphs)
I'd like a few more blank lines here.
Myles C. Maxfield
Comment 27
2021-02-16 20:13:53 PST
Created
attachment 420588
[details]
Patch for committing
Myles C. Maxfield
Comment 28
2021-02-17 23:18:32 PST
Created
attachment 420800
[details]
Patch for committing
Myles C. Maxfield
Comment 29
2021-02-18 19:21:38 PST
The Windows errors look unrelated. I'll land tonight and watch the bots to make sure nothing bad happens.
Myles C. Maxfield
Comment 30
2021-02-18 19:27:05 PST
Committed
r273121
(
234318@main
): <
https://commits.webkit.org/234318@main
>
Myles C. Maxfield
Comment 31
2021-02-18 19:27:44 PST
Comment on
attachment 420426
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=420426&action=review
>> Source/WebCore/PAL/pal/cf/OTSVGTable.cpp:44 >> + other.table = nullptr; > > isn't this what std::exchange is for?
std::swap()
>> Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:793 >> + if (PAL::softLinkOTSVGOTSVGTableGetDocumentIndexForGlyph(m_otSVGTable.value().table, glyphs[i]) != kCFNotFound) { > > Is there any perf hit for calling softLinkOTSVGOTSVGTableGetDocumentIndexForGlyph every time inside the loop?
Do you mean a perf hit because the function is soft linked, or a perf hit because we have to call it at all? If you mean because it's soft linked, the macro is actually smart enough to only do the soft linking stuff the first time it's called. The function pointer initially gets set to a stub which will look up the real function and then assign it to the function pointer. So the runtime cost for soft-linking is minimal. If you mean because we have to call it at all, we only call it for SVG fonts (see line 788 above), and almost no fonts are SVG fonts. So we're almost never going to run this code.
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