Bug 239953 - avoid setting different syntax but same value Colors in DrawGlyphsRecorder
Summary: avoid setting different syntax but same value Colors in DrawGlyphsRecorder
Status: RESOLVED DUPLICATE of bug 235604
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Process Model (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-01 22:41 PDT by Cameron McCormack (:heycam)
Modified: 2022-05-03 17:16 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2022-05-01 22:41:21 PDT
DrawGlyphsRecorder extracts the current fill and stroke colors when text is drawn.  This handles color fonts.  We extract the current colors using CGGStateGetFillColor and CGGStateGetStrokeColor, then convert the CGColors to WebCore::Colors using Color::createAndPreserveColorSpace.  The result is that we always create an out-of-line Color (i.e. one with float components), even if the original color we set came from an SRGBA<uint8_t> color value.  The two don't compare equal, and we spend time generating and processing state change display list items for this.

For the common case of the draw glyphs callback being called with the current fill and stroke set to the same CGColor object instances that we set in DrawGlyphsRecorder::populateInternalContext, we can set the fill/stroke using the brush values on m_originalState, and the graphics context state management code will detect these as the same and avoid generating changes.
Comment 1 Radar WebKit Bug Importer 2022-05-01 22:41:29 PDT
<rdar://problem/92593336>
Comment 2 Cameron McCormack (:heycam) 2022-05-03 17:16:45 PDT

*** This bug has been marked as a duplicate of bug 235604 ***