Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2018-06-08 08:03:21 +0000
committerSravan Kumar Lakkimsetti2018-06-11 08:57:35 +0000
commit3c542a45c323b28e9b0dc4797e857d609b325ac8 (patch)
tree0d33aba0ca36de46bdcefa8de8ffdf7cb9f10379
parent478943a3d3db3b661443175e2e9f2772ed22d22a (diff)
downloadeclipse.platform.swt-3c542a45c323b28e9b0dc4797e857d609b325ac8.tar.gz
eclipse.platform.swt-3c542a45c323b28e9b0dc4797e857d609b325ac8.tar.xz
eclipse.platform.swt-3c542a45c323b28e9b0dc4797e857d609b325ac8.zip
Bug 535123 - [HiDPI][GTK3] Black bands visible in Eclipse UI on x2
display Fixes black band issues in snippet 365 and tool bars and CTabFolder. this uses setting of scale factor to surface. rather than manipulating the co-ordinates. Revert "Revert "Bug 534817 - screenshots do not change"" This reverts commit 742c1cbd39bb33d4c9827db948582faef531b1ba. This revert fixes SWTBot problem in capturing screenshots Conflicts: bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java Change-Id: Ibd8dc7ae70befe6db98d89e9d76f7ce68e7ffc8f
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index 8eebf8d42a..127e1e216e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -1562,17 +1562,25 @@ void fillGradientRectangleInPixels(int x, int y, int width, int height, boolean
fromRGB = backgroundRGB;
toRGB = foregroundRGB;
}
- if (vertical) {
- width = width * (DPIUtil.getDeviceZoom() / 100);
- } else {
- height = height * (DPIUtil.getDeviceZoom() / 100);
+ long /*int*/ cairo = data.cairo;
+ long /*int*/ pattern;
+ /*
+ * Here the co-ordinates passed are in points for GTK3.
+ * That means the user is expecting surface to be at
+ * device scale equal to current scale factor. So need
+ * to set the device scale to current scale factor
+ */
+ long /*int*/ surface = Cairo.cairo_get_target(cairo);
+ if ((GTK.GTK3)&&(surface != 0)) {
+ float scaleFactor = DPIUtil.getDeviceZoom() / 100f;
+ Cairo.cairo_surface_set_device_scale(surface, scaleFactor, scaleFactor);
}
+
if (fromRGB.equals(toRGB)) {
fillRectangleInPixels(x, y, width, height);
return;
}
- long /*int*/ cairo = data.cairo;
- long /*int*/ pattern;
+
if (vertical) {
pattern = Cairo.cairo_pattern_create_linear (0.0, 0.0, 0.0, 1.0);
} else {

Back to the top