Opened 10 years ago

Closed 10 months ago

Last modified 10 months ago

#2047 closed defect (fixed)

wxMSW: refresh garbage on some logical functions

Reported by: awrobel Owned by:
Priority: low Milestone:
Component: wxMSW Version: dev-latest
Keywords: wxDC blit DoBlit DoStretchBlit raster operations ROP Cc: awrobel
Blocked By: Blocking:
Patch: yes

Description

  • Start the drawing sample
  • Press F6
  • Scroll around and watch the stars wxSET, wxCLEAR and

wxINVERT. Move them out of the window and back into it.

=> You'll find ugly garbage.

  • Now press Ctrl+G several times to shrink the display.

=> The three mentioned stars don't shrink but stay in
original size.

After shrinking the image, you can now also see
additional wrong pixels in e.g. the "original image".
Compare it with the "with colormask" image where those
ugly pixels do not appear. This is described in
http://sourceforge.net/support/tracker.php?aid=1000038
Maybe, those two user-scale problems are somehow
related or caused by similar code?

Tested on Win2000.

Attachments (1)

blit-dst-only.patch download (729 bytes) - added by awi 10 months ago.
Set source DC to NULL for 'destination-only' blit operations.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by wojdyr

  • Keywords wxDC added
  • Status changed from new to confirmed

confirmed in trunk (2.9) on WinXP.

comment:2 Changed 3 years ago by oneeyeman

Just tested this bug on the revision 70307.
The first problem still exist. After scrolling all images out and bringing them back, there appears to be a garbage on the screen.

However the second problem is now gone. After pressing Ctrl+G the first time, images redraw and start shrinking without any issues.

comment:3 Changed 3 years ago by vadz

  • Keywords cant-fix added
  • Priority changed from normal to low
  • Summary changed from wxMSW/2.5.3: refresh garbage on some logical functions to wxMSW: refresh garbage on some logical functions

I see both problems with current svn (~2.9.3) under Windows 7. For the second one, these 3 stars do shrink but they're truncated, not scaled, unlike the other ones.

Unfortunately I'm as clueless as to why does this happen as 7 years ago. We handle these raster ops in exactly the same way as all the other ones so it just looks like a Windows bug. I don't see what can we do about it.

In any case, ROPs are deprecated now and wxGC should be used instead...

comment:4 Changed 3 years ago by oneeyeman

If the ROPs are deprecated can we close this ticket and mention something in the docs?

comment:5 Changed 3 years ago by vadz

Deprecated shouldn't mean broken. I've already decreased the bug severity but the bug seems real enough.

Changed 10 months ago by awi

Set source DC to NULL for 'destination-only' blit operations.

comment:6 Changed 10 months ago by awi

  • Keywords blit DoBlit DoStretchBlit raster operations ROP added; cant-fix removed
  • Patch set
  • Version set to dev-latest

Problems occur only for these raster operations where only destination bitmap (DC) is involved (for unary destination operations).
The reason for this is that for all blit-family operations where only destination DC is involved, the source DC needs to be set to NULL. If it's not NULL then strange artifacts can be visible on the output bitmap.

Patch attached.

comment:7 Changed 10 months ago by vadz

Wow! I wonder how did you manage to find this bug, I'd have never thought that passing a valid HDC could result in this, even if it's unused.

Anyhow, thanks a lot, will commit soon!

comment:8 Changed 10 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75731]) Fix handling of wxSET, wxCLEAR and wxINVERT ROPs in wxMSW.

Avoid passing source HDC to MaskBlt() for these ROPs which only use the
destination HDC as they produce garbage instead of just ignoring the source in
if it's non-NULL.

Closes #2047.

comment:9 Changed 10 months ago by VZ

(In [75738]) Fix handling of wxSET, wxCLEAR and wxINVERT ROPs in wxMSW.

Avoid passing source HDC to MaskBlt() for these ROPs which only use the
destination HDC as they produce garbage instead of just ignoring the source in
if it's non-NULL.

Closes #2047.

Note: See TracTickets for help on using tickets.