[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] HI-DPI displays and WebGL issues

This brings up a bunch of new questions

What should this do?

   gl.texImage2D(......, canvas) 

For compatibility it should upload a CSS pixel version of the canvas. 

Possibly we could add a gl.pixelStorei parameter like gl.UNPACK_USE_HI_RESOLUTION_WEBGL or something if you want the full res backing store?

Similarly the same thing applies to the img tag.  I don't know what the final img tag spec will be but regardless if you functionally have this

    <img alt="image description" src="" srcset="/path/to/otherimage.png 2x">

       gl.texImage2D(......, img) 
Which image do you get, "image.png" or "otherimage.png", and at what size?  Do we need a new API to handle that case? Or at least a way of querying either the size you're going to get or the size you got



    gl.getTexLevelParameteri(gl.TEXTURE_2D, level, GL_TEXTURE_LEVEL_DIMENSIONS);

or both