Bug 217749 - [Cocoa] Don't change the text matrix multiple times inside FontCascade::drawGlyphs()
Summary: [Cocoa] Don't change the text matrix multiple times inside FontCascade::drawG...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks: 217506
  Show dependency treegraph
 
Reported: 2020-10-15 00:23 PDT by Myles C. Maxfield
Modified: 2020-10-15 16:52 PDT (History)
9 users (show)

See Also:


Attachments
Patch (15.38 KB, patch)
2020-10-15 00:41 PDT, Myles C. Maxfield
simon.fraser: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2020-10-15 00:23:28 PDT
[Cocoa] Don't change the text matrix multiple times inside FontCascade::drawGlyphs()
Comment 1 Myles C. Maxfield 2020-10-15 00:41:34 PDT
Created attachment 411415 [details]
Patch
Comment 2 Sam Weinig 2020-10-15 09:28:40 PDT
Comment on attachment 411415 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411415&action=review

> Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:66
> +    static NeverDestroyed<AffineTransform> result(0, -1, 1, 0, 0, 0);

I don't think a NeverDestroyed should be needed here, as AffineTransform should have a trivial destructor. We should probably make constructions of AffineTransform constexpr (given it is built on std::array, this should be easy enough) so we can make this even moar const. (none of that is needed for this change, just writing this here to note it).

> Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:85
> +    CGPoint position = FloatPoint(point.x(), point.y() + ascentDelta);

Seems a bit weird to make a CGPoint this way. Any reason not to use CGPointMake directly?
Comment 3 Simon Fraser (smfr) 2020-10-15 09:59:35 PDT
Comment on attachment 411415 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411415&action=review

> Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:144
> +    if (!platformData.isColorBitmapFont())

Why are color bitmap fonts special?
Comment 4 Myles C. Maxfield 2020-10-15 10:58:23 PDT
Comment on attachment 411415 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411415&action=review

>> Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:144
>> +    if (!platformData.isColorBitmapFont())
> 
> Why are color bitmap fonts special?

I have no idea 😅 This branch is probably wrong, but this patch just moves the code around. I've filed https://bugs.webkit.org/show_bug.cgi?id=217767 to see if we can remove it.
Comment 5 Myles C. Maxfield 2020-10-15 10:59:48 PDT
Comment on attachment 411415 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411415&action=review

> Source/WebCore/ChangeLog:18
> +        calls, we have now way of knowing whether it was modified by WebKit or

now way
Comment 6 Myles C. Maxfield 2020-10-15 16:51:14 PDT
Committed r268561: <https://trac.webkit.org/changeset/268561>
Comment 7 Radar WebKit Bug Importer 2020-10-15 16:52:20 PDT
<rdar://problem/70358054>