1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 07:15:39 +02:00

Bug 574271: Draw characters in the correct color on macos

There is a bug in SWT on macos - Bug 568777 - with the cache of single
character drawStrings with transparent backgrounds as a performance
boost. This causes the terminal to draw some characters in the
wrong color.

The workaround is to not draw with transparency, which should be fine
because we just filled the background with the same color that the
1 character string will draw with.

The performance, measured with TerminalTextUITest in Fast mode with
no throttling, does not seem affected and in my testing there does
not seem to be any graphic side effects.

Change-Id: I1b0aadae100d81a8f4533ba73273ccc8202e068f
This commit is contained in:
Jonah Graham 2021-06-19 10:11:05 -04:00
parent a319ec5c2e
commit 6b332e35cd
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.control; singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.control; singleton:=true
Bundle-Version: 5.2.0.qualifier Bundle-Version: 5.2.1.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin

View file

@ -176,7 +176,7 @@ public class TextLineRenderer implements ILinelRenderer {
// TODO why do I have to draw the background character by character?????? // TODO why do I have to draw the background character by character??????
gc.fillRectangle(xx, y, fStyleMap.getFontWidth(), fStyleMap.getFontHeight()); gc.fillRectangle(xx, y, fStyleMap.getFontWidth(), fStyleMap.getFontHeight());
if (c != ' ' && c != '\000') { if (c != ' ' && c != '\000') {
gc.drawString(String.valueOf(c), fStyleMap.getCharOffset(c) + xx, y, true); gc.drawString(String.valueOf(c), fStyleMap.getCharOffset(c) + xx, y, false);
} }
} }
} else { } else {