Closed Bug 647485 Opened 13 years ago Closed 13 years ago

canvas drawImage rasterizes SVG first and scales after

Categories

(Core :: Graphics: Canvas2D, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 603488

People

(Reporter: evik.gm, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16
Build Identifier: Firefox 4.0

I have an img element which has an SVG file as source. Changing the width and height of the image element scales the drawing smooth. If I want to draw that image to a canvas, it will rasterize the SVG in its given dimensions (given in the SVG tag) and then scale the rasterized image to the desired dimensions which results an ugly drawing. IE9, Chrome10 and Safari5 all renders the SVG to the desired dimensions and puts it into the canvas resulting in a smooth image.

Reproducible: Always

Steps to Reproduce:
1. drawImage an image element with SVG src to the canvas with a scale other then 1:1
2.
3.
Actual Results:  
The SVG is rasterized in its "natural" size (given in the SVG tag, not even related to the Image element containing it) and then scales to the dimensions given in drawImage.

Expected Results:  
The SVG should be rasterized to the dimensions given in the drawImage parameters to ensure smooth scaling.
Version: unspecified → 4.0 Branch
Component: General → Canvas: 2D
Product: Firefox → Core
QA Contact: general → canvas.2d
Version: 4.0 Branch → Trunk
Corrected to refer to svg attachment
Attachment #523823 - Attachment is obsolete: true
Keywords: testcase
Hardware: x86_64 → x86
Presumably the issue is that we try to get an image surface out of the <svg> and the draw+scale that....
Status: UNCONFIRMED → NEW
Ever confirmed: true
Precisely. See bug 603488.
Status: NEW → RESOLVED
Closed: 13 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: