[ wxwindows-Bugs-1605712 ] wxMac: DC bug on drawing line
SourceForge.net
noreply at sourceforge.net
Mon May 28 16:37:17 PDT 2007
Bugs item #1605712, was opened at 2006-11-29 23:44
Message generated for change (Comment added) made by ippei
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1605712&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMac specific
Group: None
Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Ippei UKAI (ippei)
Assigned to: Stefan Csomor (csomor)
Summary: wxMac: DC bug on drawing line
Initial Comment:
DC stuff is probably broken on wxMac 2.8rc1. See attached screenshot which is supposed to have cross in the centre.
It's being drawn with the following code:
// draw center lines over display
dc.SetPen(wxPen(wxT("WHITE"), 1, wxSOLID));
dc.SetLogicalFunction(wxINVERT);
dc.DrawLine(offsetX + w/2, offsetY,
offsetX + w/2, offsetY + h);
dc.DrawLine(offsetX, offsetY + h/2,
offsetX + w, offsetY+ h/2);
----------------------------------------------------------------------
>Comment By: Ippei UKAI (ippei)
Date: 2007-05-29 00:37
Message:
Logged In: YES
user_id=1072623
Originator: YES
New report:
http://sourceforge.net/tracker/index.php?func=detail&aid=1727161&group_id=9863&atid=109863
----------------------------------------------------------------------
Comment By: Ippei UKAI (ippei)
Date: 2007-05-28 18:34
Message:
Logged In: YES
user_id=1072623
Originator: YES
It's glitchy, but working on 10.4u SDK. I'm filing new bug report for the
remaining problem with 10.3.9 SDK. Thanks.
----------------------------------------------------------------------
Comment By: Ippei UKAI (ippei)
Date: 2006-12-11 11:40
Message:
Logged In: YES
user_id=1072623
Originator: YES
I'll wait till the RC2 then.
I wonder what happens when compiled against 10.3.9 SDK though.
Wouldn't it be better to use the CG implementation only with 10.4u (or
even 10.5) SDK or later?
If the whole CG immigration thing is for the future compatibility, then
when compiled against 10.3.9 SDK we just don't need to be compatible beyond
that, do we? QD for PPC will not probably be dropped from the release for a
while, and if Apple did, developers have to compile against newer SDK
anyway.
As the ./configure can now specify Mac's SDK, would it be possible to
configure the build against older SDKs to use the old QD implementation
automatically?
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2006-12-04 07:29
Message:
Logged In: YES
user_id=81467
Originator: NO
I've moved the discussed implementation from the old CoreGraphics
implementation to the new graphics context. For XOR and INVERT the
kCGBlendModeExclusion mode is set and Anti-aliasing is turned off. Please
test with CVS HEAD or the next drop
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2006-12-01 06:41
Message:
Logged In: YES
user_id=81467
Originator: NO
My current idea ist that the best option for backwards compatibility at
least on 10.4 would be to always have white color and diff blend mode with
anti-aliasing turned of as soon as mode is xor or invert.
The rest has to be documented, yes, but there is always just so much time
to spend on free things ...
Best,
STefan
----------------------------------------------------------------------
Comment By: Ippei UKAI (ippei)
Date: 2006-11-30 17:57
Message:
Logged In: YES
user_id=1072623
Originator: YES
OK... I think I understood the workaround involves non-documented API etc.
I might have to find a good combination of colour and alpha channel that
can replace invert to give a quick workaround. All above code does is to
draw a visible line over the picture, and the picture is drawn to DC every
time just before the line is drawn.
I'd rather wait till the bug is fixed though 'cause all I hoped was to
recompile the current version without touching the codes.
Meanwhile, could I request to document this issue clearly when the 2.8
release comes out?
I'm quite sure there are many applications that use inverse/xor drawings,
and they should stick with older versions till the issue is resolved
(unless they reimplement things).
Thanks
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2006-11-30 13:34
Message:
Logged In: YES
user_id=81467
Originator: NO
sorry, I forgot to add, that of course in all XOR and INVERT modes we
would have to turn off anti-alisaing immediately otherwise things cannot
work
Stefan
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2006-11-30 12:26
Message:
Logged In: YES
user_id=81467
Originator: NO
yes, on 10.4 we would have a diff blend mode, which would solve the
problem for a white pen, but not eg for a black xored line. so the overall
more elegant solution is to use the overlay which draws a nice overlay over
any window content.
I'll have to check the splitter code, most probably this is not yet
adapted, I've once changed the sash code accordingly.
Thanks,
Stefan
----------------------------------------------------------------------
Comment By: Ippei UKAI (ippei)
Date: 2006-11-30 10:59
Message:
Logged In: YES
user_id=1072623
Originator: YES
I see. I thought Difference Blend Mode introduced for Tiger does the job.
But 10.3.9 compatibility would be still the problem...
Anyway, does this change has to be set default for the 2.8 release?
This is certainly a big back-ward compatibility issue that requires some
work-around for our app to update the wxWidgets library.
By the way, is this one failing for the same reason?
http://sourceforge.net/tracker/index.php?func=detail&aid=1605669&group_id=9863&atid=109863
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2006-11-30 04:38
Message:
Logged In: YES
user_id=81467
Originator: NO
Hi
2.8 is using Core Graphics for rendering and there are no modes available
that would need an access to the back-buffer like XOR or INVERT, I've added
the wxOverlay class for these situations, look eg in the wxCaret
implementation
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1605712&group_id=9863
More information about the wx-dev
mailing list