Closed
Bug 380203
Opened 18 years ago
Closed 17 years ago
Mac scrollbar rendering extremely broken under complex transformations
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: roc, Assigned: cbarrett)
References
Details
Attachments
(2 files)
1.18 KB,
text/xml
|
Details | |
3.78 KB,
patch
|
jaas
:
review+
vlad
:
superreview+
|
Details | Diff | Splinter Review |
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).
Assignee | ||
Comment 1•18 years ago
|
||
We should figure out if we're going to do something about this for 1.9.
Flags: blocking1.9?
Reporter | ||
Comment 2•18 years ago
|
||
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.
Reporter | ||
Comment 3•18 years ago
|
||
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.
Assignee | ||
Comment 5•17 years ago
|
||
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.
Assignee | ||
Comment 6•17 years ago
|
||
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.
Assignee | ||
Comment 7•17 years ago
|
||
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.
Assignee | ||
Comment 8•17 years ago
|
||
Attachment #283646 -
Flags: review?(joshmoz)
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.
Attachment #283646 -
Flags: superreview?(vladimir)
Attachment #283646 -
Flags: review?(joshmoz)
Attachment #283646 -
Flags: review+
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+
Assignee | ||
Comment 11•17 years ago
|
||
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.
Assignee | ||
Comment 12•17 years ago
|
||
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
Closed: 17 years ago
Resolution: --- → FIXED
Comment 13•17 years ago
|
||
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
Flags: in-litmus?
Comment 14•17 years ago
|
||
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.
Description
•