Re: [whatwg] Canvas image to blob/dataurl within Worker

On Thu, Apr 9, 2015 at 9:44 AM, Kenneth Russell <kbr@google.com> wrote:

> On Tue, Apr 7, 2015 at 6:42 PM, Robert O'Callahan <robert@ocallahan.org>
> wrote:
> > As far as I can tell, the only significant difference between
> > this and WorkerCanvas is using an HTMLCanvasElement "bitmaprenderer" as a
> > zero-copy way to render an ImageBitmap, instead of HTMLImageElement.
>
> That's the main difference. Another is that OffscreenCanvas can be
> directly instantiated from both the main thread and workers.
>

Oh, it was always intended that WorkerCanvas be instantiable from a Worker,
it just wasn't written down (and "Exposed" hadn't been invented yet :-).)


> >Can you explain what the problem was with using HTMLImageElement?
>
> One browser implementer pointed out that HTMLImageElement has several
> complex internal states related to loading, and they do not want to
> conflate that with the display of ImageBitmaps. I've documented this
> in the OffscreenCanvas proposal. (I originally thought Canvas had more
> complex internal state, but now think that it can be easier to define
> new behavior against a new canvas context than <img>.)
>

I like your original thought better :-). I don't think circumventing the
HTMLImageElement states is an issue, in Gecko at least. To me it seems
desirable for an element displaying an ImageBitmap to get its intrinsic
size from the ImageBitmap, which fits better with HTMLImageElement than
HTMLCanvasElement. For example this would make object-fit and
object-position useful on such elements.

Rob
-- 
oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
owohooo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oioso
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
owohooo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
ooofo
otohoeo ofoioroeo ooofo ohoeololo.

Received on Thursday, 9 April 2015 05:29:54 UTC