Closed
Bug 148551
Opened 22 years ago
Closed 22 years ago
SetImageData/SetAlphaData incorrectly converting offset on XP_PC
Categories
(Core Graveyard :: Image: Painting, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.1beta
People
(Reporter: paper, Assigned: paper)
References
Details
Attachments
(1 file)
2.61 KB,
patch
|
pavlov
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
SetImageData & SetAlphaData (mozilla/gfx2/src/) assume aOffset is referencing data in a top-down manner. PCs (XP_PC) use a bottom-up storage, so these functions adjust the passed in offset to the proper top-down position. The current code does not take into account an offset within the middle of a row. Simple Example to help clarify: We want to set (1,0) to (7,0) on a 8x11 image. Let's assume 1 byte == 1 pixel for simplification of calculations. This will result in a 88 byte image (positions 0 to 87). We call SetImageData(data, 7, 1) (data, numBytes, top-down offset) For XP_PC, top-down needs to be converted to bottom-up.. Expected Result: position 81 to 87 of imgData should be set to the new data Expected newOffset: 81 Currently SetImageData calculates newOffset = ((mSize.height - 1) * row_stride) - aOffset; newOffset = (10 * 8) - 1 newOffset = 79 Actual Result: position 79 to 85 (inclusive) of imgData will be set to new data Upcoming patch will fix this problem
Assignee | ||
Comment 1•22 years ago
|
||
Correction to line 3 of Description: these functions adjust the passed-in offset to the proper _bottom-up_ PC storage position.
Assignee | ||
Comment 2•22 years ago
|
||
ccing pav & tor pav, tor, I'll need this r='d, sr='d, and checked-in before Bug 85595
Blocks: 85595
Assignee | ||
Comment 3•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Comment 4•22 years ago
|
||
confirming to get this on radar
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 85964 [details] [diff] [review] Correctly set newOffset sr=tor
Attachment #85964 -
Flags: superreview+
Assignee | ||
Comment 6•22 years ago
|
||
pav, can you r=?
Target Milestone: mozilla1.1alpha → mozilla1.1beta
Comment 7•22 years ago
|
||
Comment on attachment 85964 [details] [diff] [review] Correctly set newOffset r=pavlov
Attachment #85964 -
Flags: review+
Comment 8•22 years ago
|
||
checked in on the trunk.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 9•22 years ago
|
||
Fixed on branch, because adt+ bug 85595 depended on this.
Keywords: fixed1.0.1
Comment 10•22 years ago
|
||
Verified patch checked into lxr.mozilla.org(trunk) and bonsai.mozilla.org(branch)
Status: RESOLVED → VERIFIED
Keywords: fixed1.0.1 → verified1.0.1
You need to log in
before you can comment on or make changes to this bug.
Description
•