Closed
Bug 393128
Opened 18 years ago
Closed 18 years ago
Drag image code does not deal with pre-multiplied alpha
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: cbarrett, Assigned: cbarrett)
Details
Attachments
(1 file)
|
2.84 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
STR:
1. Start up Minefield, have it go to the default Minefield homepage
2. Go to www.google.com
3. Drag the Google image
Expected results:
Image appears with 65% opacity
Actual results:
Background is 100% opaque white, colors show through. Definitely not normal SourceOver compositing.
I have two theories.
1) The dragging code in nsDragService works with pixels directly. Cocoa uses premultiplied alpha, so this type of direct manipulation might not be ideal. Instead, we should consider using disolveToPoint:fraction:.
2) Our use of CGContextSetCompositeOperation (http://mxr.mozilla.org/seamonkey/search?string=CGContextSetCompositeOperatio) might be screwing with the compositing operation used. We might want to do a gsave, set it to SourceOver when the drag begins, and when the drag ends do a grestore.
I'll do some investigation as time permits. I've been meaning to file this for a while now.
Flags: blocking1.9?
| Assignee | ||
Comment 1•18 years ago
|
||
Here's my proposed fix.
Turns out that gfxImageSurface returns pre-multiplied alpha, and NSBitmapImageRep also expects pre-multiplied alpha. The previous code was not pre-multiplying things, thus the odd appearance.
I took the liberty of changing return nsnull to return nil in ConstructDragImage -- it returns an ObjC type, it should use the ObjC version of null.
Attachment #277644 -
Flags: review?(joshmoz)
| Assignee | ||
Updated•18 years ago
|
Summary: Drag image appears to use the wrong composite operation → Drag image code does not deal with pre-multiplied alpha
| Assignee | ||
Updated•18 years ago
|
Attachment #277644 -
Flags: review?(joshmoz) → review?(enndeakin)
| Assignee | ||
Updated•18 years ago
|
Attachment #277644 -
Flags: review?(enndeakin) → review?(roc)
Attachment #277644 -
Flags: superreview+
Attachment #277644 -
Flags: review?(roc)
Attachment #277644 -
Flags: review+
| Assignee | ||
Comment 2•18 years ago
|
||
Checking in widget/src/cocoa/nsDragService.mm;
/cvsroot/mozilla/widget/src/cocoa/nsDragService.mm,v <-- nsDragService.mm
new revision: 1.23; previous revision: 1.22
done
(typo'd bug number in commit, oops)
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•