Closed
Bug 268215
Opened 20 years ago
Closed 19 years ago
Incorrect stretch drawing part of 8-bit alpha images
Categories
(Core Graveyard :: GFX: Win32, defect)
Tracking
(Not tracked)
RESOLVED
EXPIRED
People
(Reporter: phnixwxz1, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
Build Identifier: nsImageWin since 3.127 (2004-01-06 08:29) till now (?)
When stretch drawing portion of a 8-bit alpha image, the whole image is drawn
instead of the specified portion. This will cause problems for rendering XUL
elements with -moz-image-region style.
For example, when a png image of size 300x300 with 8-bit alpha is drawn with the
following call:
nsImageWin::Draw(context, surface,
/*aSX*/100, /*aSY*/100, /*aSWitdh*/100, /*aSHeight*/100,
/*aDX*/0, /*aDY*/0, /*aDWidth*/200, /*aDHeight*/200);
the whole 300x300 image is drawn, instead of the specified 100x100 subimage.
Problem is in nsImageWin.cpp nsImageWin::DrawComposited:
680 tor 3.127
681 PRBool scaling = PR_FALSE;
682 /* Both scaled and unscaled images come through this code */
683 if ((aDWidth != aSWidth) || (aDHeight != aSHeight)) {
684 scaling = PR_TRUE;
685 aDWidth = aOrigDWidth;
686 aDHeight = aOrigDHeight;
687 aSWidth = mBHead->biWidth;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
688 aSHeight = mBHead->biHeight;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
689 }
...............
738 tor 3.127 RectStretch(aSWidth, aSHeight, aDWidth, aDHeight,
739 0, 0, aDWidth-1, aDHeight-1,
740 tor 3.126 mImageBits, mRowBytes, imageRGB,
strideRGB, 24);
^^^^^^^^^^^
741 tor 3.127 RectStretch(aSWidth, aSHeight, aDWidth, aDHeight,
742 0, 0, aDWidth-1, aDHeight-1,
743 tor 3.126 mAlphaBits, mARowBytes, imageAlpha,
strideAlpha, 8);
^^^^^^^^^^^^
.........
I think the problem can be resolved by modifying the above code into the following:
PRBool scaling = PR_FALSE;
/* Both scaled and unscaled images come through this code */
if ((aDWidth != aSWidth) || (aDHeight != aSHeight)) {
scaling = PR_TRUE;
aDWidth = aOrigDWidth;
aDHeight = aOrigDHeight;
//bug aSWidth = mBHead->biWidth;
//bug aSHeight = mBHead->biHeight;
}
...............
RectStretch(aSWidth, aSHeight, aDWidth, aDHeight,
0, 0, aDWidth-1, aDHeight-1,
// bug
mImageBits + aSY * mRowBytes + aSX * 3,
mRowBytes, imageRGB, strideRGB, 24);
RectStretch(aSWidth, aSHeight, aDWidth, aDHeight,
0, 0, aDWidth-1, aDHeight-1,
// bug
mAlphaBits + aSY * mARowBytes + aSX,
mARowBytes, imageAlpha, strideAlpha, 8);
Reproducible: Always
Steps to Reproduce:
1.
2.
3.| Reporter | ||
Updated•20 years ago
|
Summary: Incorrect stretch drawing part of 8-bit alpha images → Incorrect stretch drawing part of 8-bit alpha images
Comment 1•20 years ago
|
||
tor, you checked in the code in question...
Comment 2•19 years ago
|
||
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
Comment 3•19 years ago
|
||
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•