diff options
author | Silenio Quarti <silenio> | 2008-09-03 16:01:20 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2008-09-03 16:01:20 +0000 |
commit | be4f8a91a78c2db7d8c649d80f6b2efc07d94102 (patch) | |
tree | 39630a03d29fb491013cd33d6884e559cd0d94f8 | |
parent | 3e758e40f3fef25e35eb91563ab2554285d64719 (diff) | |
download | eclipse.platform.swt-be4f8a91a78c2db7d8c649d80f6b2efc07d94102.tar.gz eclipse.platform.swt-be4f8a91a78c2db7d8c649d80f6b2efc07d94102.tar.xz eclipse.platform.swt-be4f8a91a78c2db7d8c649d80f6b2efc07d94102.zip |
241062 - [consistency] Font#getFontData() not safe from non-ui thread on MacOS (back port to 3.4.1)
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Font.java | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Font.java index ae55795855..5050738e94 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Font.java @@ -298,25 +298,11 @@ public FontData[] getFontData() { if ((this.style & OS.bold) != 0) style |= SWT.BOLD; if (atsName.indexOf("Italic") != -1) style |= SWT.ITALIC; if (atsName.indexOf("Bold") != -1) style |= SWT.BOLD; - int deviceDPI = device.getDPI().y; - int screenDPI = getScreenDPI().y; - FontData data = new FontData(name, size * screenDPI/deviceDPI, style); + FontData data = new FontData(name, size, style); data.atsName = atsName; return new FontData[]{data}; } -Point getScreenDPI() { - int gdevice = OS.GetMainDevice(); - int[] ptr = new int[1]; - OS.memmove(ptr, gdevice, 4); - GDevice device = new GDevice(); - OS.memmove(device, ptr[0], GDevice.sizeof); - OS.memmove(ptr, device.gdPMap, 4); - PixMap pixmap = new PixMap(); - OS.memmove(pixmap, ptr[0], PixMap.sizeof); - return new Point (OS.Fix2Long (pixmap.hRes), OS.Fix2Long (pixmap.vRes)); -} - /** * Invokes platform specific functionality to allocate a new font. * <p> @@ -395,9 +381,7 @@ void init(String name, float height, int style, String atsName) { } } } - int deviceDPI = device.getDPI().y; - int screenDPI = getScreenDPI().y; - this.size = height * deviceDPI/screenDPI; + this.size = height; if (font == 0) { Font systemFont = device.systemFont; this.handle = systemFont.handle; |