summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-02 12:44:14 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-02 12:44:14 -0400
commit1893ee00dbd109fe547456f5a6765a11b749c94d (patch)
treea729e1ff2e962464e544f474332572deec9d92e4 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
parent0a6fae738241e7836d36af20392709c3e65a2652 (diff)
downloadeclipse.platform.swt-1893ee00dbd109fe547456f5a6765a11b749c94d.tar.gz
eclipse.platform.swt-1893ee00dbd109fe547456f5a6765a11b749c94d.tar.xz
eclipse.platform.swt-1893ee00dbd109fe547456f5a6765a11b749c94d.zip
the GTK3 version check is not necessary -> all calls already have a USE_CAIRO check
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java19
1 files changed, 7 insertions, 12 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 085b4c1e92..f715234c03 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
@@ -1038,7 +1038,8 @@ void drawImageAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHei
}
long /*int*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, srcWidth, srcHeight);
if (pixbuf == 0) return;
- gdk_pixbuf_get_from_window (pixbuf, srcImage.pixmap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+ long /*int*/ colormap = OS.gdk_colormap_get_system();
+ OS.gdk_pixbuf_get_from_drawable(pixbuf, srcImage.pixmap, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
long /*int*/ pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
byte[] line = new byte[stride];
@@ -1074,10 +1075,11 @@ void drawImageMask(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeig
if (srcWidth != destWidth || srcHeight != destHeight) {
long /*int*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, srcWidth, srcHeight);
if (pixbuf != 0) {
- gdk_pixbuf_get_from_window (pixbuf, colorPixmap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+ long /*int*/ colormap = OS.gdk_colormap_get_system();
+ OS.gdk_pixbuf_get_from_drawable(pixbuf, colorPixmap, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
long /*int*/ maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, srcWidth, srcHeight);
if (maskPixbuf != 0) {
- gdk_pixbuf_get_from_window (maskPixbuf, maskPixmap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+ OS.gdk_pixbuf_get_from_drawable(maskPixbuf, maskPixmap, 0, srcX, srcY, 0, 0, srcWidth, srcHeight);
int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
long /*int*/ pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
byte[] line = new byte[stride];
@@ -1228,7 +1230,8 @@ void drawImageXRender(Image srcImage, int srcX, int srcY, int srcWidth, int srcH
long /*int*/ scale(long /*int*/ src, int srcX, int srcY, int srcWidth, int srcHeight, int destWidth, int destHeight) {
long /*int*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, srcWidth, srcHeight);
if (pixbuf == 0) return 0;
- gdk_pixbuf_get_from_window (pixbuf, src, srcX, srcY, 0, 0, srcWidth, srcHeight);
+ long /*int*/ colormap = OS.gdk_colormap_get_system();
+ OS.gdk_pixbuf_get_from_drawable(pixbuf, src, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
long /*int*/ scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
OS.g_object_unref(pixbuf);
return scaledPixbuf;
@@ -4209,12 +4212,4 @@ public String toString () {
return "GC {" + handle + "}";
}
-long /*int*/ gdk_pixbuf_get_from_window(long /*int*/ dest, long /*int*/ src, int src_x, int src_y, int dest_x, int dest_y, int width, int height) {
- if (OS.GTK3) {
- return OS.gdk_pixbuf_get_from_window (dest, src_x, src_y, width, height);
- } else {
- long /*int*/ cmap = OS.gdk_colormap_get_system();
- return OS.gdk_pixbuf_get_from_drawable (dest, src, cmap, src_x, src_y, dest_x, dest_y, width, height);
- }
-}
}