[whatwg] Need clarification on DOM exceptions thrown by canvas 2D drawImage

Jeff Muizelaar jmuizelaar at mozilla.com
Tue Aug 9 14:00:55 PDT 2011


On 2011-08-09, at 8:47 AM, Philip Taylor wrote:

> Does the clamp-to-edge behaviour work fine when the source rectangle
> is entirely inside the image? e.g. the image
> 
> 8800
> 8800
> 0088
> 0088
> 
> (where each digit is a pixel) drawn at 2x scale with bilinear
> filtering should give
> 
> 88862000
> 88862000
> 88862000
> 66653222
> 22235666
> 00026888
> 00026888
> 00026888
> 
> because of the filtering requirements. If CoreGraphics can't do that
> then it's broken (per the spec) regardless of how source rectangles
> are handled. Or is it able to do clamp-to-edge fine up to the edge of
> the source image, just not extend that beyond the image when the
> source rectangle is expanded further?

Afaict, it is able to do clamp-to-edge fine up to the edge of the source image

For example, I get something like the following in CoreGraphics:

88871000
88871000
88871000
77761111
11116777
00017888
00017888
00017888

I can't explain the 7/1 vs. 6/2 but it does the right thing as far as edge padding goes.

-Jeff


More information about the whatwg mailing list