Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2018-05-09 13:49:11 +0000
committerSravan Kumar Lakkimsetti2018-05-09 14:30:46 +0000
commit6a595ca4d2accb36c336a08183008671ad23a9f3 (patch)
tree3a9865294668e246bd478969b72e14d2ea741a4f /bundles/org.eclipse.swt/Eclipse SWT/gtk/org
parent90e1260a0ee075e12f75f02081d41c32371f6123 (diff)
downloadeclipse.platform.swt-6a595ca4d2accb36c336a08183008671ad23a9f3.tar.gz
eclipse.platform.swt-6a595ca4d2accb36c336a08183008671ad23a9f3.tar.xz
eclipse.platform.swt-6a595ca4d2accb36c336a08183008671ad23a9f3.zip
Bug 534500 - Double Scaling with X11 backend for images drawn with gc
Change-Id: I0b38c0d72f32831f7b579bc11e3aaff08b028025 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
index d6e493cfb1..8301156deb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
@@ -1390,7 +1390,11 @@ void init(int width, int height) {
this.type = SWT.BITMAP;
/* Create the pixmap */
- surface = GDK.gdk_window_create_similar_surface(GDK.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);
+ if (GTK.GTK3) {
+ surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height);
+ } else {
+ surface = GDK.gdk_window_create_similar_surface(GDK.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);
+ }
if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES);
// When we create a blank image we need to set it to 100 in GTK3 as we don't scale here.
// Cairo will scale for us

Back to the top