Re: [whatwg] High-density canvases

2015-04-16 Thread Robert O'Callahan
On Thu, Apr 16, 2015 at 7:07 AM, Justin Novosad wrote: > In the interest of moving forward with this, I began an experimental > implementation of the renderedPixelWidth/Height propsal ( > https://wiki.whatwg.org/wiki/CanvasRenderedPixelSize) in Blink. I ran > into > some issues, which I document

Re: [whatwg] High-density canvases

2015-04-15 Thread Kenneth Russell
On Wed, Apr 15, 2015 at 1:46 PM, Dean Jackson wrote: > > On 16 Apr 2015, at 6:42 am, Elliott Sprehn wrote: > > 3. Accessing rendered pixel size is layout-inducing. To avoid layout >> >> thrashing, we should consider making this an asynchronous getter (e.g. >> asyncGetBoundignClientRect). This wou

Re: [whatwg] High-density canvases

2015-04-15 Thread Dean Jackson
> On 16 Apr 2015, at 6:42 am, Elliott Sprehn wrote: > > 3. Accessing rendered pixel size is layout-inducing. To avoid layout > thrashing, we should consider making this an asynchronous getter (e.g. > asyncGetBoundignClientRect). This would also prevent renderedsizechanged > events from firing fr

Re: [whatwg] High-density canvases

2015-04-15 Thread Elliott Sprehn
On Wed, Apr 15, 2015 at 12:07 PM, Justin Novosad wrote: > In the interest of moving forward with this, I began an experimental > implementation of the renderedPixelWidth/Height propsal ( > https://wiki.whatwg.org/wiki/CanvasRenderedPixelSize) in Blink. I ran > into > some issues, which I documen

Re: [whatwg] High-density canvases

2015-04-15 Thread Justin Novosad
In the interest of moving forward with this, I began an experimental implementation of the renderedPixelWidth/Height propsal ( https://wiki.whatwg.org/wiki/CanvasRenderedPixelSize) in Blink. I ran into some issues, which I documented in the "issues" section of the proposal. I would like to draw y

Re: [whatwg] High-density canvases

2014-07-02 Thread Robert O'Callahan
On Thu, Jul 3, 2014 at 3:03 AM, Justin Novosad wrote: > On Fri, Jun 27, 2014 at 6:42 PM, Robert O'Callahan > wrote: > This behavior seems sound at first glance, but because that arithmetic may > >> induce a change to the intrinsic aspect ratio due to rounding, step 3) > may > >> not jump out of

Re: [whatwg] High-density canvases

2014-07-02 Thread Justin Novosad
On Fri, Jun 27, 2014 at 6:42 PM, Robert O'Callahan wrote: > On Sat, Jun 28, 2014 at 3:41 AM, Justin Novosad wrote: > >> Example of a problematic renderedsizechange event listener: >> >> canvas.width = Math.floor(canvas.renderedPixelWidth * myPixelScale); >> canvas.height = Math.floor(canvas.rend

Re: [whatwg] High-density canvases

2014-06-27 Thread Robert O'Callahan
On Sat, Jun 28, 2014 at 3:41 AM, Justin Novosad wrote: > Example of a problematic renderedsizechange event listener: > > canvas.width = Math.floor(canvas.renderedPixelWidth * myPixelScale); > canvas.height = Math.floor(canvas.renderedPixelHeight * myPixelScale); > I don't know why anyone would a

Re: [whatwg] High-density canvases

2014-06-27 Thread Justin Novosad
On Thu, Jun 26, 2014 at 6:25 PM, Robert O'Callahan wrote: > On Fri, Jun 27, 2014 at 2:00 AM, Justin Novosad wrote: > >> Hadn't thought of that. object-fit seems smells dangerous. I think we may >> need to define explicit behaviors for renderedPixelWidth/Height for the >> different object fit mod

Re: [whatwg] High-density canvases

2014-06-26 Thread Robert O'Callahan
On Fri, Jun 27, 2014 at 2:00 AM, Justin Novosad wrote: > Hadn't thought of that. object-fit seems smells dangerous. I think we may > need to define explicit behaviors for renderedPixelWidth/Height for the > different object fit modes. I don't think so. Given renderedPixelWidth/Height returns th

Re: [whatwg] High-density canvases

2014-06-26 Thread Justin Novosad
Hadn't thought of that. object-fit seems smells dangerous. I think we may need to define explicit behaviors for renderedPixelWidth/Height for the different object fit modes. For example, with 'object-fit: contains', will the renderedPixelWidth/Height be computed in a way to fill the element's conte

Re: [whatwg] High-density canvases

2014-06-25 Thread Robert O'Callahan
On Thu, Jun 26, 2014 at 10:13 AM, Robert O'Callahan wrote: > To clarify, I think a version of option #1 would be the best way to go. > renderedPixelWidth would return the current canvas buffer width when the > canvas element's CSS specified value for 'width' is 'auto', and similar for > height. >

Re: [whatwg] High-density canvases

2014-06-25 Thread Robert O'Callahan
On Thu, Jun 26, 2014 at 10:10 AM, Robert O'Callahan wrote: > On Thu, Jun 26, 2014 at 2:49 AM, Justin Novosad wrote: > >> I was wondering if there is anything we can do with this feature to >> prevent >> web apps from creating layout feedback loops. What I mean is that if the >> event listener f

Re: [whatwg] High-density canvases

2014-06-25 Thread Robert O'Callahan
On Thu, Jun 26, 2014 at 2:49 AM, Justin Novosad wrote: > I was wondering if there is anything we can do with this feature to prevent > web apps from creating layout feedback loops. What I mean is that if the > event listener for renderedsizechange changes the layout of the page in a > way that d

Re: [whatwg] High-density canvases

2014-06-25 Thread Justin Novosad
I was wondering if there is anything we can do with this feature to prevent web apps from creating layout feedback loops. What I mean is that if the event listener for renderedsizechange changes the layout of the page in a way that does not preserve renderedPixelWidth/Height, we can get into a lot

Re: [whatwg] High-density canvases

2014-06-24 Thread Robert O'Callahan
On Wed, Jun 25, 2014 at 3:30 PM, Rik Cabanier wrote: > Add a new event renderedsizechange to HTMLCanvasElement. This event does > not bubble and is not cancelable. Whenever the value that would be returned > by renderedPixelWidth orrenderedPixelHeight changes, queue a task to fire > renderedsizec

Re: [whatwg] High-density canvases

2014-06-24 Thread Rik Cabanier
On Mon, Jun 23, 2014 at 6:06 PM, Robert O'Callahan wrote: > On Tue, Jun 24, 2014 at 12:27 PM, Robert O'Callahan > wrote: > >> I'll do that now. >> > > Done. > http://wiki.whatwg.org/wiki/CanvasRenderedPixelSize > The wiki states: Add a new event renderedsizechange to HTMLCanvasElement. This ev

Re: [whatwg] High-density canvases

2014-06-24 Thread Kenneth Russell
On Mon, Jun 23, 2014 at 6:06 PM, Robert O'Callahan wrote: > On Tue, Jun 24, 2014 at 12:27 PM, Robert O'Callahan > wrote: >> >> I'll do that now. > > > Done. > http://wiki.whatwg.org/wiki/CanvasRenderedPixelSize Fantastic. Thanks Rob. That looks great. Filed crbug.com/388532 about implementing th

Re: [whatwg] High-density canvases

2014-06-23 Thread Robert O'Callahan
On Tue, Jun 24, 2014 at 12:27 PM, Robert O'Callahan wrote: > I'll do that now. > Done. http://wiki.whatwg.org/wiki/CanvasRenderedPixelSize Rob -- Jtehsauts tshaei dS,o n" Wohfy Mdaon yhoaus eanuttehrotraiitny eovni le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o Whhei csha iids teo

Re: [whatwg] High-density canvases

2014-06-23 Thread Robert O'Callahan
On Tue, Jun 24, 2014 at 11:44 AM, Kenneth Russell wrote: > If there's no concern about potential duplicated functionality then > let's add the attributes to the canvas element. They'll be easier for > developers to understand and easier to verify as obviously correct. > > How should we proceed? W

Re: [whatwg] High-density canvases

2014-06-23 Thread Kenneth Russell
On Mon, Jun 23, 2014 at 4:25 PM, Robert O'Callahan wrote: > On Tue, Jun 24, 2014 at 8:54 AM, Kenneth Russell wrote: >> >> It's hard to predict. A more general API would be better than a >> canvas-specific one, assuming it solves the problem. getBoxQuads can >> return different types of CSS boxes

Re: [whatwg] High-density canvases

2014-06-23 Thread Robert O'Callahan
On Tue, Jun 24, 2014 at 8:54 AM, Kenneth Russell wrote: > It's hard to predict. A more general API would be better than a > canvas-specific one, assuming it solves the problem. getBoxQuads can > return different types of CSS boxes (content, padding, border, margin) > -- will it be obvious to web

Re: [whatwg] High-density canvases

2014-06-23 Thread Kenneth Russell
On Thu, Jun 19, 2014 at 4:20 PM, Robert O'Callahan wrote: > On Fri, Jun 20, 2014 at 6:06 AM, Kenneth Russell wrote: >> >> It is a little unfortunate that a canvas-specific solution is needed. >> Is it known whether document.getBoxQuads solves this problem in >> Firefox? > > > It doesn't. > > Geck

Re: [whatwg] High-density canvases

2014-06-20 Thread Justin Novosad
On Thu, Jun 19, 2014 at 7:03 PM, Robert O'Callahan wrote: > On Fri, Jun 20, 2014 at 7:32 AM, Justin Novosad wrote: > >> +1 from me too. But I have one concern in terms of future proofing, >> because >> I would like to keep the door open for auto-resizing as a possible future >> improvement. In a

Re: [whatwg] High-density canvases

2014-06-19 Thread Robert O'Callahan
On Fri, Jun 20, 2014 at 6:06 AM, Kenneth Russell wrote: > It is a little unfortunate that a canvas-specific solution is needed. > Is it known whether document.getBoxQuads solves this problem in > Firefox? > It doesn't. Gecko (and I assume other engines) typically snaps CSS box edges to device p

Re: [whatwg] High-density canvases

2014-06-19 Thread Robert O'Callahan
On Fri, Jun 20, 2014 at 7:32 AM, Justin Novosad wrote: > +1 from me too. But I have one concern in terms of future proofing, because > I would like to keep the door open for auto-resizing as a possible future > improvement. In an eventual auto-resize proposal, we will want to make > the "preferre

Re: [whatwg] High-density canvases

2014-06-19 Thread Robert O'Callahan
On Fri, Jun 20, 2014 at 2:54 AM, Stephen White wrote: > I assume that the size change event would fire: > >- on browser page zoom >- on pinch-zoom >- when a CSS animation (e.g., scale) changes the canvas size in CSS >pixels > > For browsers that implement the latter two off the ma

Re: [whatwg] High-density canvases

2014-06-19 Thread Justin Novosad
+1 from me too. But I have one concern in terms of future proofing, because I would like to keep the door open for auto-resizing as a possible future improvement. In an eventual auto-resize proposal, we will want to make the "preferredsizechange" event cancelable. If we make the event non-cancelab

Re: [whatwg] High-density canvases

2014-06-19 Thread Dean Jackson
> On 20 Jun 2014, at 12:54 am, Stephen White wrote: > > On Thu, Jun 12, 2014 at 11:42 PM, Robert O'Callahan > wrote: > I think I'd rather not take control of canvas resizing away from > applications, even opt-in. That leads to complexity such as extra API for > slaving other canvases. I also

Re: [whatwg] High-density canvases

2014-06-19 Thread Kenneth Russell
On Thu, Jun 19, 2014 at 7:54 AM, Stephen White wrote: > On Thu, Jun 12, 2014 at 11:42 PM, Robert O'Callahan > wrote: > >> I think I'd rather not take control of canvas resizing away from >> applications, even opt-in. That leads to complexity such as extra API for >> slaving other canvases. I also

Re: [whatwg] High-density canvases

2014-06-19 Thread Stephen White
On Thu, Jun 12, 2014 at 11:42 PM, Robert O'Callahan wrote: > I think I'd rather not take control of canvas resizing away from > applications, even opt-in. That leads to complexity such as extra API for > slaving other canvases. I also think we'd be better off sticking to the > invariant that the

Re: [whatwg] High-density canvases

2014-06-19 Thread Justin Novosad
On Thu, Jun 19, 2014 at 12:01 AM, Robert O'Callahan wrote: > On Thu, Jun 19, 2014 at 11:52 AM, Robert O'Callahan > wrote: > >> On Thu, Jun 19, 2014 at 3:30 AM, Justin Novosad wrote: >> >>> I am currently trying an experimental approach where canvases that are >>> drawn to, but never read from (

Re: [whatwg] High-density canvases

2014-06-18 Thread Mark Callow
On 19/06/2014 00:30, Justin Novosad wrote: > My main point is, there is potentially significant progress in terms > of HD canvas rendering that can be achieved without any changes to the > spec (other than perhaps an opt-in flag). If it works out well without > an explicit opt-in, legacy websites w

Re: [whatwg] High-density canvases

2014-06-18 Thread Robert O'Callahan
On Thu, Jun 19, 2014 at 11:52 AM, Robert O'Callahan wrote: > On Thu, Jun 19, 2014 at 3:30 AM, Justin Novosad wrote: > >> I am currently trying an experimental approach where canvases that are >> drawn to, but never read from (no toDataURL or getImageData calls) have >> their contents stored as a

Re: [whatwg] High-density canvases

2014-06-18 Thread Rik Cabanier
On Wed, Jun 18, 2014 at 8:30 AM, Justin Novosad wrote: > In the previous incarnation of High density canvases (i.e. getImageDataHD > and friends), we worked under the assumption that it was okay to have a > backing store with a pixel density that is higher than CSS pixel density. > And I think th

Re: [whatwg] High-density canvases

2014-06-18 Thread Robert O'Callahan
On Thu, Jun 19, 2014 at 3:30 AM, Justin Novosad wrote: > I am currently trying an experimental approach where canvases that are > drawn to, but never read from (no toDataURL or getImageData calls) have > their contents stored as a command buffer, rather than a pixel buffer. > There must be a cli

Re: [whatwg] High-density canvases

2014-06-18 Thread Justin Novosad
In the previous incarnation of High density canvases (i.e. getImageDataHD and friends), we worked under the assumption that it was okay to have a backing store with a pixel density that is higher than CSS pixel density. And I think that was perfectly acceptable. If I recall correctly, the feature

Re: [whatwg] High-density canvases

2014-06-17 Thread Mark Callow
On 13/06/2014 12:42, Robert O'Callahan wrote: > Here's an alternative proposal which I think is a bit simpler and more > flexible: > Expose two new DOM attributes on HTMLCanvasElement: > readonly attribute long preferredWidth; > readonly attribute long preferredHeight; > These attributes ar

Re: [whatwg] High-density canvases

2014-06-12 Thread Robert O'Callahan
[Resurrecting old thread] On Tue, Sep 10, 2013 at 12:00 PM, Ian Hickson wrote: > It would be nice to fix these all at once, and I think we can, by > introducing a configuration option on getContext(), in the style of WebGL: > >getContext('2d', { density: 'autosize' }); > > This would trigger

Re: [whatwg] High-density canvases

2013-11-25 Thread Ian Hickson
On Tue, 10 Sep 2013, Ian Hickson wrote: > On Tue, 10 Sep 2013, Ian Hickson wrote: > > > > It would be nice to fix these all at once, and I think we can, by > > introducing a configuration option on getContext(), in the style of > > WebGL: > > > >getContext('2d', { density: 'autosize' }); >

Re: [whatwg] High-density canvases

2013-10-02 Thread Stephen White
On Fri, Sep 27, 2013 at 5:51 PM, Ian Hickson wrote: > On Tue, 10 Sep 2013, Stephen White wrote: > > > > For posterity, here were our objections to the original high-DPI canvas > > spec: > >>- It doesn't scale well to non-integer devicePixelRatios > > Can you elaborate on this? I don't see why

Re: [whatwg] High-density canvases

2013-09-27 Thread Ian Hickson
On Mon, 9 Sep 2013, Rik Cabanier wrote: > On Mon, Sep 9, 2013 at 5:00 PM, Ian Hickson wrote: > > > > So my understanding is that the reason this feature failed is that > > there's existing content that assumes a 1:1 ratio, and having an > > automatic high-density mode was making some pages end u

Re: [whatwg] High-density canvases

2013-09-13 Thread Robert O'Callahan
On Thu, Sep 12, 2013 at 10:42 AM, Ian Hickson wrote: > On Thu, 12 Sep 2013, Robert O'Callahan wrote: > > On Wed, Sep 11, 2013 at 11:24 AM, Ian Hickson wrote: > > > On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > > > Pinch-zoom is hard because we don't want to trigger reflows or other > > > > e

Re: [whatwg] High-density canvases

2013-09-12 Thread Ian Hickson
On Thu, 12 Sep 2013, Robert O'Callahan wrote: > On Wed, Sep 11, 2013 at 11:24 AM, Ian Hickson wrote: > > On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > > Pinch-zoom is hard because we don't want to trigger reflows or other > > > expensive behavior on pinch-zoom. I'd leave pinch-zoom out of it

Re: [whatwg] High-density canvases

2013-09-12 Thread Dean Jackson
On 11 Sep 2013, at 3:20 am, Robert O'Callahan wrote: > On Tue, Sep 10, 2013 at 1:26 PM, Rik Cabanier wrote: > There's a thread on www-style: > http://lists.w3.org/Archives/Public/www-style/2012Nov/0144.html > It's been in firefox for a while and blink is going to ship it soon: > https://groups.

Re: [whatwg] High-density canvases

2013-09-12 Thread Robert O'Callahan
On Wed, Sep 11, 2013 at 11:24 AM, Ian Hickson wrote: > On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > Pinch-zoom is hard because we don't want to trigger reflows or other > > expensive behavior on pinch-zoom. I'd leave pinch-zoom out of it for > > now. > > Unless I'm missing something fundamen

Re: [whatwg] High-density canvases

2013-09-11 Thread Ian Hickson
On Wed, 11 Sep 2013, Rik Cabanier wrote: > On Wed, Sep 11, 2013 at 11:24 AM, Ian Hickson wrote: > > On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > > > > > Pinch-zoom is hard because we don't want to trigger reflows or other > > > expensive behavior on pinch-zoom. I'd leave pinch-zoom out of it

Re: [whatwg] High-density canvases

2013-09-11 Thread Rik Cabanier
On Wed, Sep 11, 2013 at 11:24 AM, Ian Hickson wrote: > On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > > > Pinch-zoom is hard because we don't want to trigger reflows or other > > expensive behavior on pinch-zoom. I'd leave pinch-zoom out of it for > > now. > > Unless I'm missing something fund

Re: [whatwg] High-density canvases

2013-09-11 Thread Ian Hickson
On Wed, 11 Sep 2013, Robert O'Callahan wrote: > > Pinch-zoom is hard because we don't want to trigger reflows or other > expensive behavior on pinch-zoom. I'd leave pinch-zoom out of it for > now. Unless I'm missing something fundamental, changing the pixel density doesn't cause a layout, it's

Re: [whatwg] High-density canvases

2013-09-11 Thread Tab Atkins Jr.
On Wed, Sep 11, 2013 at 1:20 AM, Robert O'Callahan wrote: >> > > Actually what I really think we should do is also change the >> > > window.devicePixelRatio for pinch zoom. Combined with the suggestions >> for >> > > canvas, that would allow (as Rik pointed out on IRC) for high-quality >> > > canv

Re: [whatwg] High-density canvases

2013-09-11 Thread Robert O'Callahan
On Tue, Sep 10, 2013 at 1:26 PM, Rik Cabanier wrote: > There's a thread on www-style: > http://lists.w3.org/Archives/Public/www-style/2012Nov/0144.html > It's been in firefox for a while and blink is going to ship it soon: > > https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/RyUSi

Re: [whatwg] High-density canvases

2013-09-11 Thread Robert O'Callahan
On Tue, Sep 10, 2013 at 10:46 PM, Tab Atkins Jr. wrote: > High-end laptops have high-dpi screens (the Pixel I'm using right now > has one), and they're slowly spreading down the price scale. > On Mac there are Retinas of course, and on Windows Firefox defaults to a non-1.0 devicePixelRatio on man

Re: [whatwg] High-density canvases

2013-09-10 Thread Tab Atkins Jr.
On Tue, Sep 10, 2013 at 6:24 PM, Glenn Maynard wrote: >> Yeah, my suggestion, if we do this, would be to not do it until high >> density displays are even more widely available than now. This is mostly a >> convenience and performance-improving API, not a critical feature add. > > High-DPI display

Re: [whatwg] High-density canvases

2013-09-10 Thread Glenn Maynard
On Mon, Sep 9, 2013 at 7:31 PM, Ian Hickson wrote: > Right, resetting the context would definitely be part of the deal. This > mode would be specifically defined as a mode where you had to listen to > onresize or your canvas would almost certainly get cleared sooner or > later. In fact, we could

Re: [whatwg] High-density canvases

2013-09-10 Thread Boris Zbarsky
On 9/10/13 4:13 PM, Ian Hickson wrote: I guess we'll just have to treat devicePixelRatio as legacy and introduce a new value that's the real device:pixel ratio, then. I would be interested in some data on what different UAs do with devicePixelRatio... -Boris

Re: [whatwg] High-density canvases

2013-09-10 Thread Boris Zbarsky
On 9/10/13 4:22 PM, Dean Jackson wrote: I think there are two separate things a developer might want: - the number of actual pixels that correspond to 1 CSS px without zoom What are the use cases for this, as opposed to "number of actual pixels that correspond to 1 CSS px"? And are you talk

Re: [whatwg] High-density canvases

2013-09-10 Thread Ian Hickson
On Wed, 11 Sep 2013, Dean Jackson wrote: > On 11 Sep 2013, at 12:14 am, Stephen White > wrote: > > > > now that some browsers are including browser zoom (page zoom) in > > window.devicePixelRatio > > Ouch. Who is doing this and why? Why ouch? Actually what I really think we should do is also

Re: [whatwg] High-density canvases

2013-09-10 Thread Kornel LesiƄski
On Tue, 10 Sep 2013 21:22:51 +0100, Dean Jackson wrote: I think there are two separate things a developer might want: - the number of actual pixels that correspond to 1 CSS px without zoom - the page zoom If you merge the two, then an unsuspecting developer might think that the user has zoo

Re: [whatwg] High-density canvases

2013-09-10 Thread Dean Jackson
On 11 Sep 2013, at 12:14 am, Stephen White wrote: > now that some browsers are including browser zoom (page zoom) in > window.devicePixelRatio Ouch. Who is doing this and why? Dean

Re: [whatwg] High-density canvases

2013-09-10 Thread Ian Hickson
On Wed, 11 Sep 2013, Dean Jackson wrote: > > I think there are two separate things a developer might want: > > - the number of actual pixels that correspond to 1 CSS px without zoom > - the page zoom Why? Exposing page zoom separately from device density seems like a fundamental abstraction fai

Re: [whatwg] High-density canvases

2013-09-10 Thread Rik Cabanier
On Tue, Sep 10, 2013 at 12:45 PM, Dean Jackson wrote: > > On 11 Sep 2013, at 5:32 am, Ian Hickson wrote: > > > On Wed, 11 Sep 2013, Dean Jackson wrote: > >> On 11 Sep 2013, at 12:14 am, Stephen White > >> wrote: > >>> > >>> now that some browsers are including browser zoom (page zoom) in > >>>

Re: [whatwg] High-density canvases

2013-09-10 Thread Dean Jackson
On 11 Sep 2013, at 6:13 am, Ian Hickson wrote: > On Wed, 11 Sep 2013, Dean Jackson wrote: >> On 11 Sep 2013, at 5:32 am, Ian Hickson wrote: >>> On Wed, 11 Sep 2013, Dean Jackson wrote: On 11 Sep 2013, at 12:14 am, Stephen White wrote: > > now that some browsers are includin

Re: [whatwg] High-density canvases

2013-09-10 Thread Ian Hickson
On Wed, 11 Sep 2013, Dean Jackson wrote: > On 11 Sep 2013, at 5:32 am, Ian Hickson wrote: > > On Wed, 11 Sep 2013, Dean Jackson wrote: > >> On 11 Sep 2013, at 12:14 am, Stephen White > >> wrote: > >>> > >>> now that some browsers are including browser zoom (page zoom) in > >>> window.devicePix

Re: [whatwg] High-density canvases

2013-09-10 Thread Dean Jackson
On 11 Sep 2013, at 5:32 am, Ian Hickson wrote: > On Wed, 11 Sep 2013, Dean Jackson wrote: >> On 11 Sep 2013, at 12:14 am, Stephen White >> wrote: >>> >>> now that some browsers are including browser zoom (page zoom) in >>> window.devicePixelRatio >> >> Ouch. Who is doing this and why? > >

Re: [whatwg] High-density canvases

2013-09-10 Thread Boris Zbarsky
On 9/10/13 2:55 PM, Dean Jackson wrote: Ouch. Who is doing this and why? Any browser in which zoom changes the size of a CSS pixel, and because that's the definition of devicePixelRatio? -Boris

Re: [whatwg] High-density canvases

2013-09-10 Thread Justin Novosad
There is another closely related issue that's been discussed before: adding a redraw callback to 2d canvas. In the past we discussed this for solving the problem of recoverring from a gpu context loss, but it seems there may be better reasons to consider adding a redraw callback such as freeing me

Re: [whatwg] High-density canvases

2013-09-10 Thread Stephen White
For posterity, here were our objections to the original high-DPI canvas spec: - The API feels like a short-term hack to automagically do something that the developer may or may not want done (e.g., if the game/app was tuned for particular resolution, or for pixel-exact rendering) that we'

Re: [whatwg] High-density canvases

2013-09-09 Thread Ian Hickson
On Tue, 10 Sep 2013, Ian Hickson wrote: > > It would be nice to fix these all at once, and I think we can, by > introducing a configuration option on getContext(), in the style of > WebGL: > >getContext('2d', { density: 'autosize' }); > > This would trigger the following behaviour: When th

Re: [whatwg] High-density canvases

2013-09-09 Thread Rik Cabanier
On Mon, Sep 9, 2013 at 5:00 PM, Ian Hickson wrote: > On Wed, 17 Jul 2013, Rik Cabanier wrote: > > Ian wrote: > > > > > > The density aspect of this might be pointless, given the failure of > > > getImageDataHD(); if we're dropping that one, I'll drop this one at > > > the same time. > > > > Yes,

Re: [whatwg] High-density canvases

2013-09-09 Thread Ian Hickson
On Tue, 10 Sep 2013, Dean Jackson wrote: > > > > So my understanding is that the reason this feature failed is that > > there's existing content that assumes a 1:1 ratio, and having an > > automatic high-density mode was making some pages end up with canvases > > with four canvas pixels per CSS

Re: [whatwg] High-density canvases

2013-09-09 Thread Dean Jackson
On 10 Sep 2013, at 10:00 am, Ian Hickson wrote: > On Wed, 17 Jul 2013, Rik Cabanier wrote: >> Ian wrote: >>> >>> The density aspect of this might be pointless, given the failure of >>> getImageDataHD(); if we're dropping that one, I'll drop this one at >>> the same time. >> >> Yes, please dr

Re: [whatwg] High-density canvases

2013-09-09 Thread Tab Atkins Jr.
On Mon, Sep 9, 2013 at 5:00 PM, Ian Hickson wrote: > It would be nice to fix these all at once, and I think we can, by > introducing a configuration option on getContext(), in the style of WebGL: > >getContext('2d', { density: 'autosize' }); > > This would trigger the following behaviour: When

[whatwg] High-density canvases

2013-09-09 Thread Ian Hickson
On Wed, 17 Jul 2013, Rik Cabanier wrote: > Ian wrote: > > > > The density aspect of this might be pointless, given the failure of > > getImageDataHD(); if we're dropping that one, I'll drop this one at > > the same time. > > Yes, please drop it since the HD methods are going away from the one >