Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca62784f authored by chenjean's avatar chenjean
Browse files

fix(HCT): White outline with white text when text following an wahitespace

Goal:
Ensure the accurate rendering of the background rectangle color(e.g. white text with balck background) for text following an whitespace.

Root Cause:
The text color is updated during the whitespace character processing in determineContrastingBackgroundColor, but the bgPaint update is skipped due to the 'skip draw background on whitespace' condition in onCharacterBounds. Consequently, subsequent text color change checks return "no text color change", resulting in the return of an incorrect bgPaint color.

Solution:
Implement synchronized updates for both the text color and bgPaint.

Bug: 401070918
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: manually test on whitespace case (e.g. whitespace + text)
Test: atest core/tests/coretests/src/android/text/LayoutTest.java
Test: atest cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/TextViewHighContrastTextTests.kt
Change-Id: Icf43fc57755f07b33d47324f5436894ce7dbcfde
parent 09558664
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment