RESOLVED DUPLICATE of bug 235604239953
avoid setting different syntax but same value Colors in DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=239953
Summary avoid setting different syntax but same value Colors in DrawGlyphsRecorder
Cameron McCormack (:heycam)
Reported 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.
Attachments
Radar WebKit Bug Importer
Comment 1 2022-05-01 22:41:29 PDT
Cameron McCormack (:heycam)
Comment 2 2022-05-03 17:16:45 PDT
*** This bug has been marked as a duplicate of bug 235604 ***
Note You need to log in before you can comment on or make changes to this bug.