Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-02-15 20:16:20 +0000
committerEric Williams2019-03-11 19:12:09 +0000
commitb83f349e78cabfeffbaefdb40e59463b256b1084 (patch)
tree36b0d0ae9bb8a247328a3a0ef501d92bd0dbc39a /bundles
parenteef687cb0ba0e614571caf5af7dc4ad829aeed1b (diff)
downloadeclipse.platform.swt-b83f349e78cabfeffbaefdb40e59463b256b1084.tar.gz
eclipse.platform.swt-b83f349e78cabfeffbaefdb40e59463b256b1084.tar.xz
eclipse.platform.swt-b83f349e78cabfeffbaefdb40e59463b256b1084.zip
Bug 544507: [GTK3] Snippet273 is broken
Replace the hacks from bug 446075 as they break Snippet273. Reset the clipping after SWT.EraseItem drawing is finished, as this Cairo context is re-used on GTK3.14+. Change-Id: I59479b5edc30d60830d0e8f3b5af71469474e8f0 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java2
3 files changed, 4 insertions, 4 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 7f16a67993..38733a507d 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
@@ -17,7 +17,6 @@ import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.cairo.*;
import org.eclipse.swt.internal.gtk.*;
-import org.eclipse.swt.widgets.*;
/**
* Class <code>GC</code> is where all of the drawing capabilities that are
@@ -3141,9 +3140,6 @@ public void setClipping(Rectangle rect) {
setClippingInPixels(DPIUtil.autoScaleUp(drawable, rect));
}
void setClippingInPixels(Rectangle rect) {
- if (drawable instanceof Tree || drawable instanceof Table) {
- return; //FIXME: This is an atrocious hack for bug 446075
- }
if (rect == null) {
resetClipping();
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 2c54a38c01..1d10480088 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -2999,6 +2999,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ snapshot,
if (hooks (SWT.EraseItem)) {
+ Cairo.cairo_save(cr);
/*
* Cache the selection state so that it is not lost if a
* PaintListener wants to draw custom selection foregrounds.
@@ -3064,6 +3065,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ snapshot,
}
}
gc.dispose();
+ Cairo.cairo_restore(cr);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 8d2806b1b3..495b1d5563 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -3079,6 +3079,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ snapshot,
if (textRenderer != 0) gtk_cell_renderer_get_preferred_size (textRenderer, handle, null, null);
if (hooks (SWT.EraseItem)) {
+ Cairo.cairo_save(cr);
/*
* Cache the selection state so that it is not lost if a
* PaintListener wants to draw custom selection foregrounds.
@@ -3130,6 +3131,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ snapshot,
}
}
gc.dispose();
+ Cairo.cairo_restore (cr);
}
}
}

Back to the top