diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-10-24 12:56:07 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-10-24 12:56:07 -0400 |
commit | 9fc8665c72017ac9e9a5c41d2c7268083a59fe01 (patch) | |
tree | 8985225b8e93d0da214c2b10eda138537fb92564 /bundles/org.eclipse.swt/Eclipse SWT Theme | |
parent | 349459091b102fd601c4529f951a9f14324c71bd (diff) | |
download | eclipse.platform.swt-9fc8665c72017ac9e9a5c41d2c7268083a59fe01.tar.gz eclipse.platform.swt-9fc8665c72017ac9e9a5c41d2c7268083a59fe01.tar.xz eclipse.platform.swt-9fc8665c72017ac9e9a5c41d2c7268083a59fe01.zip |
Bug 390041 - Use cairo instead of gdk_draw_pixbuf()
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java index 2212fea8d1..c41736b071 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java @@ -98,7 +98,15 @@ void drawImage(Theme theme, Image image, GC gc, Rectangle bounds) { OS.g_object_unref(pixbuf); //TODO - stretching if (rendered != 0) { - OS.gdk_draw_pixbuf(drawable, gc.handle, rendered, 0, 0, bounds.x, bounds.y, bounds.width, bounds.height, OS.GDK_RGB_DITHER_NORMAL, 0, 0); + if (OS.USE_CAIRO) { + long /*int*/ cairo = OS.gdk_cairo_create (drawable); + OS.gdk_cairo_set_source_pixbuf (cairo, gc.handle, 0, 0); + Cairo.cairo_rectangle (cairo,bounds.x,bounds.y,bounds.width,bounds.height); + Cairo.cairo_fill(cairo); + Cairo.cairo_destroy(cairo); + } else { + OS.gdk_draw_pixbuf(drawable, gc.handle, rendered, 0, 0, bounds.x, bounds.y, bounds.width, bounds.height, OS.GDK_RGB_DITHER_NORMAL, 0, 0); + } OS.g_object_unref(rendered); } OS.gtk_icon_source_free(source); |