On 14/06/2012 17:00, Gregg Tavares (社用)
wrote:
That code is broken. With or without your proposed changes it will fail when the drawing buffer size != canvas size. Currently they can be not equal either because css pixels != device pixels or because the implementation could not allocate a drawing buffer the size of the canvas. With your proposed change, the latter remains a possibility. What is generally hiding the brokenness now is that the viewport is clamped to MAX_VIEWPORT_DIM which is commonly the limit of the allocation for very large canvases. This is not always the case. A implementation may choose to allocate a drawing buffer < MAX_VIEWPORT_DIM for memory or performance reasons or it may be forced to because MAX_RENDERBUFFER_SIZE is less than MAX_VIEWPORT_DIM. The code is broken. It needs to be fixed to calculate resolution from gl.drawingBuffer{Width,Height}. Regards -Mark |