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

On Wed, Apr 15, 2015 at 1:15 PM, Kenneth Russell <kbr@google.com> wrote:

> If repeatedly transferring ImageBitmaps of the same size into the same
> <img> won't cause repeated re-layouts, that alleviates my concern
> about efficiency of using images as the output path. I expect that a
> single OffscreenCanvas will be used to produce output to multiple
> areas on the page (whether into images or canvases) but that it will
> be sized large enough so that all of the ImageBitmaps it produces will
> cover the largest of those areas, avoiding repeatedly resizing the
> OffscreenCanvas.
>

So you want to produce multiple ImageBitmaps of the same (largest) size and
then render them to multiple elements in the page, each element cropping
its ImageBitmap to a (potentially) different size? Isn't that going to be
wasteful of memory?

There is one other problem which has come up repeatedly in canvas
> applications: needing to be able to accurately measure the number of
> device pixels covered by a canvas, so pixel-accurate rendering can be
> done. https://wiki.whatwg.org/wiki/CanvasRenderedPixelSize addresses
> this and it's currently being implemented in Chromium. There is no
> such mechanism for images. It would be necessary to understand exactly
> how many device pixels the output image is covering in the document so
> that the OffscreenCanvas can be sized appropriately. Using a canvas
> element for the display of these ImageBitmaps avoids this problem. It
> also makes the API more symmetric; a canvas-like object produces the
> ImageBitmap, and a canvas element is used to view it. Do you have any
> suggestion for how this issue would be solved with <img>?
>

We could support renderedPixelWidth/Height on <img> as well as <canvas>.
But this is a valid argument in favor of rendering those ImageBitmaps
through <canvas>.

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 Wednesday, 15 April 2015 02:13:54 UTC