Closed Bug 250786 Opened 21 years ago Closed 20 years ago

[Xlib] scaled images render as garbage

Categories

(Core Graveyard :: GFX: Xlib, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha5

People

(Reporter: Biesinger, Assigned: Biesinger)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

see, for example, the bookmark folder icon in the classic theme - it's 22x16, downscaled to 16x16 (I think).
related to bug 250635?
hm... this specific image does not use -moz-image-region. also, this is limited to the xlib toolkit.
Summary: scaled gifs render as garbage → [Xlib] scaled gifs render as garbage
in fact, this seems to affect also pngs with alpha channels as well as images without any transparency
Summary: [Xlib] scaled gifs render as garbage → [Xlib] scaled images render as garbage
Attached patch patch (obsolete) — Splinter Review
Assignee: roland.mainz → cbiesinger
Status: NEW → ASSIGNED
So, the problem was: aDX/aDY are coordinates pointing somewhere into the rendering context. So they are just used to position the scaled image. Trying to put the scaled image into the buffer at aDX/aDY position probably wrote to random memory, although I didn't verify that; possibly RectStretch just did nothing. So the fix is: Scale the image into position (0, 0) in the allocated buffer, and draw that result at (aDX, aDY).
Target Milestone: --- → mozilla1.8beta
Comment on attachment 153577 [details] [diff] [review] patch this doesn't fix pngs with an alpha channel
Attachment #153577 - Attachment is obsolete: true
Attachment #153577 - Flags: review?(tor) → review-
Attached patch patch v2Splinter Review
testcase for scaling PNGs with alpha: data:text/html,<img src="http://www.w3.org/Graphics/PNG/alphatest.png" width="300">
Attachment #153578 - Flags: review?(tor) → review?(roland.mainz)
Target Milestone: mozilla1.8beta → mozilla1.8alpha5
Attachment #153578 - Flags: review?(roland.mainz) → review+
Checking in gfx/src/xlib/nsImageXlib.cpp; /cvsroot/mozilla/gfx/src/xlib/nsImageXlib.cpp,v <-- nsImageXlib.cpp new revision: 1.47; previous revision: 1.46 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: