summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-16 10:41:49 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-16 10:41:49 -0400
commitc727147cfc912981c3a3385133f2828fe1d74e9b (patch)
tree6632fb669f1a7a860cce07a194bc2d7f8e34d6be /bundles/org.eclipse.swt/Eclipse SWT/cocoa
parenta104ef04f5c11c447be0b7779b1621be8be740f1 (diff)
downloadeclipse.platform.swt-c727147cfc912981c3a3385133f2828fe1d74e9b.tar.gz
eclipse.platform.swt-c727147cfc912981c3a3385133f2828fe1d74e9b.tar.xz
eclipse.platform.swt-c727147cfc912981c3a3385133f2828fe1d74e9b.zip
Bug 386274 - [OpenGL] Transparent background flicker in GLCanvas starting 3.7.2
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
index 7e3599f4e9..b2b5edd798 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
@@ -139,17 +139,21 @@ public void drawBackground (GC gc, int x, int y, int width, int height) {
void drawBackground (int /*long*/ id, NSGraphicsContext context, NSRect rect) {
super.drawBackground(id, context, rect);
if (glcontext != null) {
- context.saveGraphicsState();
- context.setCompositingOperation(OS.NSCompositeClear);
- if (visiblePath == null) {
- int /*long*/ visibleRegion = getVisibleRegion();
- visiblePath = getPath(visibleRegion);
- OS.DisposeRgn(visibleRegion);
+ if (isObscured()) {
+ glcontext.setValues(new int[]{-1}, OS.NSOpenGLCPSurfaceOrder);
+ context.saveGraphicsState();
+ context.setCompositingOperation(OS.NSCompositeClear);
+ if (visiblePath == null) {
+ int /*long*/ visibleRegion = getVisibleRegion();
+ visiblePath = getPath(visibleRegion);
+ OS.DisposeRgn(visibleRegion);
+ }
+ visiblePath.addClip();
+ NSBezierPath.fillRect(rect);
+ context.restoreGraphicsState();
+ } else {
+ glcontext.setValues(new int[]{1}, OS.NSOpenGLCPSurfaceOrder);
}
- visiblePath.addClip();
- NSBezierPath.fillRect(rect);
- context.restoreGraphicsState();
- return;
}
}