[Webkit-unassigned] [Bug 239953] New: avoid setting different syntax but same value Colors in DrawGlyphsRecorder

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 1 22:41:21 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=239953

            Bug ID: 239953
           Summary: avoid setting different syntax but same value Colors
                    in DrawGlyphsRecorder
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Process Model
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: heycam at apple.com
                CC: webkit-bug-importer at group.apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220502/73aa2a46/attachment-0001.htm>


More information about the webkit-unassigned mailing list