Improper behavior of drawImage/5 when scaling images

RESOLVED DUPLICATE of bug 600390

Status

()

RESOLVED DUPLICATE of bug 600390
10 years ago
8 years ago

People

(Reporter: danzat, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
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
(Reporter)

Comment 1

10 years ago
Created attachment 377713 [details]
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
(Reporter)

Comment 3

10 years ago
Created attachment 377722 [details]
Result of the testcase on my configuration

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.
(Reporter)

Comment 6

10 years ago
@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
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 600390
You need to log in before you can comment on or make changes to this bug.