Closed
Bug 486936
Opened 16 years ago
Closed 16 years ago
canvas should take account of image-rendering
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: longsonr, Assigned: longsonr)
References
Details
Attachments
(1 file, 3 obsolete files)
12.85 KB,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•16 years ago
|
||
Hopefully the right approach, compiles but untested as I don't really know much about canvas.
Hmm.. that's not quite right; there are two pieces here, the filter applied to rendering the canvas itself when it's being CSS scaled, and whether the images rendered to the canvas are rendered with smoothing. The latter should probably have an 'auto' mode which will honor the image's style (if there is one? there may well not be a frame for an image that's to be drawn, I guess we'd just use the default then). I can take a look at fixing up the patch in the next few days.
Actually I think Robert's patch is fine as far as it goes. It makes the rendering of the canvas onto a destination surface honour the canvas's image-rendering property. Rendering images or videos into the canvas using drawImage honors imageSmoothingEnabled. That's all OK right?
The only thing that's missing, possibly, is the 'auto' value you suggest to honor an image's style. I guess that could be useful but it would make sense to be a separate patch. (I guess in principle it would be logical for image formats themselves to specify how the image data should be resampled, but I guess that's not possible except for SVG images, so never mind.)
Comment on attachment 373520 [details] [diff] [review]
patch?
I encountered someone who actually needs this!
Attachment #373520 -
Flags: review?(vladimir)
Comment on attachment 373520 [details] [diff] [review]
patch?
Ok; I think this is fine, it'd be nice if we could avoid passing the filter down to ThebesSufaceFromElement since in theory that should always be grabbing a 1:1 surface... but there may be cases where that's not true, or if we ever support SVG images, etc.
Attachment #373520 -
Flags: review?(vladimir) → review+
Assignee | ||
Comment 6•16 years ago
|
||
Attachment #373520 -
Attachment is obsolete: true
Assignee | ||
Comment 7•16 years ago
|
||
try server builds are here https://build.mozilla.org/tryserver-builds/longsonr@gmail.com-1242429208/
roc can the someone who needs this confirm that it does what he/she needs?
You've tested it, right?
Assignee | ||
Comment 9•16 years ago
|
||
That's my problem. I don't really know much about canvas and how to test it. It compiles and passes the existing reftests.
If you take an existing canvas demo (e.g. https://bug491595.bugzilla.mozilla.org/attachment.cgi?id=375888 ), set image-rendering:-moz-crispEdges and then zoom in, it should look blocky, not bilinear filtered.
Assignee | ||
Comment 11•16 years ago
|
||
(In reply to comment #10)
That works although it's -moz-crisp-edges
Assignee | ||
Comment 12•16 years ago
|
||
Assignee: nobody → longsonr
Attachment #377834 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Attachment #377922 -
Flags: review?(vladimir)
Assignee | ||
Comment 13•16 years ago
|
||
Attachment #377922 -
Attachment is obsolete: true
Attachment #377929 -
Flags: review?(vladimir)
Attachment #377922 -
Flags: review?(vladimir)
Attachment #377929 -
Flags: review?(vladimir) → review+
Assignee | ||
Comment 14•16 years ago
|
||
checked in http://hg.mozilla.org/mozilla-central/rev/a927df82dfcd and http://hg.mozilla.org/mozilla-central/rev/5b40dab2d442
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Comment 15•16 years ago
|
||
Just needs the existing dev doc for image-rendering tweaking to remove the reference to this bug.
Keywords: dev-doc-needed
Assignee | ||
Updated•16 years ago
|
Whiteboard: [dev-doc-needed comment 15]
Comment 16•16 years ago
|
||
(In reply to comment #15)
Done.
Keywords: dev-doc-needed
Whiteboard: [dev-doc-needed comment 15]
You need to log in
before you can comment on or make changes to this bug.
Description
•