W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] I believe source rectangles for HTML5 Canvas drawImage are specified incorrectly

From: Justin Novosad <junov@chromium.org>
Date: Mon, 10 Sep 2012 17:28:18 -0400
Message-ID: <CABpaAqQe4tondKSB0S3Z5BD3zRGKkEz8_XZygg5xBrn3+ZfC8A@mail.gmail.com>
To: Jeff Muizelaar <jmuizelaar@mozilla.com>
Cc: whatwg@lists.whatwg.org, Vladimir Vukicevic <vladimir@pobox.com>, Kevin Gadd <kevin.gadd@gmail.com>
On Mon, Sep 10, 2012 at 4:49 PM, Jeff Muizelaar <jmuizelaar@mozilla.com>wrote:

>
> On 2012-09-10, at 3:43 PM, Vladimir Vukicevic wrote:
>
>
> FWIW, there are also negative performance implications to clamping samples
> to the source rect. Many graphics APIs do not support this kind sampling,
> and supporting this behaviour on top of those apis requires a temporary
> copy of the subimage to be made.
>
>
You are referring to the fact that clamping modes only apply to texture
borders in OpenGL and DirectX?  That is not that big of a big deal, you can
implement the clamp in a shader.
I think Vladimir makes a good point that there are valid use cases for both
ways. To summarize the issues:
* clamping to source rect can cause filtering artefacts at boundaries,
especially visible when tiling.
* clamping to source image bounds can cause color bleeding artefacts when
rendering a sprite from a spritemap.
Received on Monday, 10 September 2012 21:28:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC