Created attachment 264267 [details] testcase Open the testcase. -- the scrollbars are in the wrong place (they should be inside the borders) -- rotate. They are painted in the wrong places, and also with the wrong contents. -- unrotate and then zoom in. Click in the scrollbar. It disappears. Perhaps the HITheme APIs can't handle drawing to a context where we have set a transformation matrix? Probably other control drawing has similar problems. We may need to detect the difficult cases and draw to an intermediate offscreen surface to address this (GTK and Windows have similar mechanisms already).
We should figure out if we're going to do something about this for 1.9.
I think we should. The whole reason we've gone through the Cairo pain (well, one of the big reasons) is so that we can do stuff like this.
Also, we support this kind of thing on Windows and Linux. On those platforms we have generic helper classes for native theme rendering that check the graphics state and take a slow path to redirect rendering via an pixmap if necessary. They also have alpha recovery since the native graphics APIs don't support alpha properly, which hopefully Cocoa doesn't need.
I'm pretty sure I know how to do this, but I have to finish a couple other things before I can do it.
I made a test app that does these same sorts of transforms -- using a different graphics API (NSScroller). It worked great, I didn't need to double buffer. We probably want to draw with that anyway for bug 54488.
Actually, it turns out we don't want to do that -- that rabbit hole goes very, very deep. Better to stick with the current code, which at least draws (mostly) correctly. It turns out that drawing *any* native form control is completely busted. I modified the above testcase to draw a button, a radiobutton, and a checkbox. All three fell over horribly. We still need to do a slow path for scrollbars, but there's something screwy with our transform matrix, I think.
I fixed the rotation in bug 397792, but there's some extra translation going on too, which I think is causing odd clipping isues? I'm not sure. Things are definitely getting better though! Buttons are still broken, and should probably also get fixed. I think we can apply a scale factor though, instead of an offscreen buffer, and get the same results without double buffering. That's a separate bug though.
Created attachment 283646 [details] [diff] [review] fix v1.0
Comment on attachment 283646 [details] [diff] [review] fix v1.0 + CGContextTranslateCTM(aCGContext, 0, aBoxRect.size.height + (2*aBoxRect.origin.y)); Spaces on both sides of the '*' operator please. Can fix on checkin.
Comment on attachment 283646 [details] [diff] [review] fix v1.0 Looks ok, but what's NS_HANDLER and friends?
Attachment #283646 - Flags: superreview?(vladimir) → superreview+
Basically, macros for doing exception handling in ObjC. Normal looking language constructs were added in 10.3 but you have to turn them on. See bug 397381.
Checking in widget/src/cocoa/nsNativeThemeCocoa.mm; /cvsroot/mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm,v <-- nsNativeThemeCocoa.mm new revision: 1.62; previous revision: 1.61 done
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a9pre) Gecko/2007100604 Minefield/3.0a9pre. I used the testcase in the bug to verify the fix, and took it through all the various transformations.
Status: RESOLVED → VERIFIED
https://litmus.mozilla.org/show_test.cgi?id=5397 added to Litmus.
Flags: in-litmus? → in-litmus+
You need to log in before you can comment on or make changes to this bug.