Closed Bug 493262 Opened 15 years ago Closed 14 years ago

Improper behavior of drawImage/5 when scaling images

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 600390

People

(Reporter: danzat, Unassigned)

References

()

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10

When using drawImage/5 in a way that scales the image, the edges of the image acquire a gradual transparency.

Reproducible: Always

Steps to Reproduce:
See attached URL for a test-case: http://pastebin.mozilla.org/650549
Attached file Testcase
This worksforme on mac, but is claimed to happen on Windows, including trunk.

vlad, I thought we took steps to prevent edge effects when scaling... do we not?
Status: UNCONFIRMED → NEW
Ever confirmed: true
The "lighter" edges can be clearly seen on the top and bottom tips of the item on the bottom.
We don't.(In reply to comment #2)
> vlad, I thought we took steps to prevent edge effects when scaling... do we
> not?

We don't.

We probably should rewrite DrawImage to use nsLayoutUtils::DrawSingleImage.
Maybe; we could also just set EXTEND_PAD in DrawImage.  The problem then would be when creating a pattern from an image... REPEAT will sorta work fine (broken at edges of repeat pattern, bleeding), and if we're not repeating we can't just set EXTEND_PAD because we'd actually get the real pad effect is someone filled an area bigger than the pattern.  I guess fixing drawImage is probably the lesser of two evils, even if it means that pattern/drawimage behaviour won't be the same.

I don't know that we can make it use DrawSingleImage though; DrawImage also handles drawing other canvas elements, video elements, etc. that would all need the right handling.
@vlad

I'm not sure I understand why are you worried about tiling, since the canvas specification does not mention tiling when using drawImage.

Also, I don't understand when would this kind of bahavior be wanted.
Duping this up to bug 493262 since there's a better testcase in there..
err.. to bug 600390
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: