aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lam2011-10-22 17:30:36 (EDT)
committerFelipe Heidrich2011-10-24 14:17:56 (EDT)
commitf4c41647aaa3faa2675335f7e68bd34a028ac49a (patch)
treee4fe3aac179ef74ee8cc28a93f8490306e62b414
parentc0ef669c9afa5a9ff8ccbbdaa0c41939cd22c383 (diff)
downloadeclipse.platform.swt-f4c41647aaa3faa2675335f7e68bd34a028ac49a.zip
eclipse.platform.swt-f4c41647aaa3faa2675335f7e68bd34a028ac49a.tar.gz
eclipse.platform.swt-f4c41647aaa3faa2675335f7e68bd34a028ac49a.tar.bz2
Make sure that drawBackgroundBuffered gets a clean dc to draw in.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index cf5d480..8268d57 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -958,8 +958,12 @@ void drawBackground (int /*long*/ hDC, RECT rect, int pixel, int tx, int ty) {
}
void drawBackgroundBuffered (int /*long*/ hDC, RECT rect) {
+ BP_PAINTPARAMS params = new BP_PAINTPARAMS();
+ params.cbSize = BP_PAINTPARAMS.sizeof;
+ params.dwFlags = OS.BPPF_ERASE;
+
int /*long*/ [] hdcBuffered = new int /*long*/ [1];
- int /*long*/ hBufferedPaint = OS.BeginBufferedPaint(hDC, rect, OS.BPBF_TOPDOWNDIB, null, hdcBuffered);
+ int /*long*/ hBufferedPaint = OS.BeginBufferedPaint(hDC, rect, OS.BPBF_TOPDOWNDIB, params, hdcBuffered);
OS.PatBlt(hdcBuffered[0], 0, 0, rect.right - rect.left, rect.bottom - rect.top, OS.BLACKNESS);
OS.BufferedPaintSetAlpha(hBufferedPaint, rect, (byte)0x00);
OS.EndBufferedPaint(hBufferedPaint, true);