[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Should texImage2D and texSubImage2D accept more element types?
On Wed, May 30, 2012 at 1:15 PM, Boris Zbarsky <email@example.com>
Hold. Back up. You tested an SVG file inside an image. I'm talking about <svg:image>, which can be pointing to a JPEG or a PNG or whatever, not just to SVG.
On 5/30/12 4:03 PM, Gregg Tavares (社用) wrote:
Firefox supports drawing an svg image to a canvas
okay, my mistake
Something like this:
What is this?
I just tried that in FF12 with a valid URL, nothing gets displayed
<svg:image xlink:ref="test.jpg" />
Note if I remove the width or height nothing gets displayed.
<image width="100" height="100" xlink:href="" />
<image id="foo" width="100" height="100" xlink:href="" />
var foo = document.getElementById("foo");
var c = document.getElementById("c");
var ctx = c.getContext("2d");
ctx.drawImage(foo, 0, 0);
And it indeed works in Firefox.
That's not part of the canvas spec AFAICT though
and then using drawImage on it to a 2d canvas works just fine in Gecko. I can't speak for other UAs. And yes, there's an issue against the 2d canvas spec to support that, last I checked.
I'm not talking about SVG support; you're correct that this is a whole separate kettle of fish. I'm talking about bitmap image support when the bitmap is loaded in an <svg:image> (because your app is perhaps using SVG instead of HTML for its UI).
I feel like SVG support for canvas 2d probably needs to specced and
sorted out before we worry about adding it to WebGL.
Well, yes, but why make people jump through those hoops?
If it works with canvas then you can always do svg->canvas->texture
Again, the desired endpoint is that <svg:image> and <html:img> have as few behavior differences as possible, since pretty much all the differences they do have are completely artificial.