Title: [295604] trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp
Revision
295604
Author
[email protected]
Date
2022-06-16 12:33:07 -0700 (Thu, 16 Jun 2022)

Log Message

File size label for attachment in mail compose shows up black instead of expected grey
https://bugs.webkit.org/show_bug.cgi?id=241600
rdar://94071484

Reviewed by Cameron McCormack.

As of https://trac.webkit.org/changeset/293867/webkit in DrawGlyphsRecorder
specifically, we use the fill color of the initial state of GraphicsContext
in the case where the new fill color we are updating to is equal to the existing
fill color for perf reasons. This revealed a bug where CGContext state gets
out of sync with it's wrapping GraphicsContext, causing an incorrect
initial state fill color and thus painting the second line of Mail
attachments in the wrong color.

This patch fixes this bug by saving and restoring the state of
m_internalContext, which we reference in the case above to determine
whether to update the fill color.

* Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::drawNativeText):

Canonical link: https://commits.webkit.org/251609@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp (295603 => 295604)


--- trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp	2022-06-16 19:30:04 UTC (rev 295603)
+++ trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp	2022-06-16 19:33:07 UTC (rev 295604)
@@ -402,7 +402,8 @@
 
 void DrawGlyphsRecorder::drawNativeText(CTFontRef font, CGFloat fontSize, CTLineRef line, CGRect lineRect)
 {
-    GraphicsContextStateSaver saver(m_owner);
+    GraphicsContextStateSaver ownerSaver(m_owner);
+    GraphicsContextStateSaver internalContextSaver(m_internalContext.get());
 
     m_owner.translate(lineRect.origin.x, lineRect.origin.y + lineRect.size.height);
     m_owner.scale(FloatSize(1, -1));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to