Re: [webkit-dev] Canvas backing resolution

2011-04-06 Thread David Hyatt
On Apr 6, 2011, at 3:01 PM, Charles Pritchard wrote: > On 4/6/2011 12:32 PM, David Hyatt wrote: >> He wants a way to detect Desktop zoom (which is done two different ways in >> WebKit). It's difficult to figure out how to expose these, since Desktop >> zoom is ultimately just the CSS zoom prope

Re: [webkit-dev] Canvas backing resolution

2011-04-06 Thread Charles Pritchard
On 4/6/2011 12:32 PM, David Hyatt wrote: He wants a way to detect Desktop zoom (which is done two different ways in WebKit). It's difficult to figure out how to expose these, since Desktop zoom is ultimately just the CSS zoom property, which can be applied to any element (so folding it into a

Re: [webkit-dev] Canvas backing resolution

2011-04-06 Thread David Hyatt
He wants a way to detect Desktop zoom (which is done two different ways in WebKit). It's difficult to figure out how to expose these, since Desktop zoom is ultimately just the CSS zoom property, which can be applied to any element (so folding it into a global makes little sense). The other kin

Re: [webkit-dev] Canvas backing resolution

2011-04-06 Thread Darin Adler
On Apr 5, 2011, at 9:52 PM, Charles Pritchard wrote: > Long-story-short, can we please expose some of the CSS pixel scaling, either > through window.devicePixelRatio I typed javascript:alert(devicePixelRatio) in Safari on my iPhone 4, and got the value 2. Isn’t this what you are asking for?

Re: [webkit-dev] Canvas backing resolution

2011-04-05 Thread Charles Pritchard
Did this move anywhere? http://www.w3.org/Bugs/Public/show_bug.cgi?id=11328 https://bugs.webkit.org/show_bug.cgi?id=51190 http://code.google.com/p/chromium/issues/detail?id=66656 Firefox is a nasty CSS hack, but it does work, and that's something to be happy about. Microsoft makes it easy; Fire

Re: [webkit-dev] Canvas backing resolution

2011-03-05 Thread Charles Pritchard
On 3/5/2011 5:41 AM, Benjamin wrote: On Fri, Mar 4, 2011 at 8:16 AM, Charles Pritchard > wrote: I'm hoping for a resolution to this issue, as we do use the canvas tag, and our canvas elements appear a little blurry on some devices: without a solution, some of

Re: [webkit-dev] Canvas backing resolution

2011-03-05 Thread Benjamin
On Fri, Mar 4, 2011 at 8:16 AM, Charles Pritchard wrote: > I'm hoping for a resolution to this issue, as we do use the canvas tag, and > our canvas elements appear a little blurry on some devices: > without a solution, some of our users will have to manually adjust the > "sharpness" of the site..

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Charles Pritchard
We do receive a resize event when zoom happens. That's what I'm currently hooked into. On Mar 4, 2011, at 12:29 PM, Kenneth Rohde Christiansen wrote: > I guess that is not even possible, as I would need to subscribe to > something like "(-min-webkit-device-pixel-ratio: 1.0)" and will only >

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
I guess that is not even possible, as I would need to subscribe to something like "(-min-webkit-device-pixel-ratio: 1.0)" and will only be notified in case the evaluation of that exact expression changes. Maybe that spec is lacking a way to subscribe to arbitrary changes in say device-pixel-ratio.

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
Hi Simon, I guess you could use the media query listener defined in http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface We support that on trunk now. This of course means that we will need to reevaluate the CSS when a pinch zoom ends, which we might be doing already given media queri

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Simon Fraser
On Mar 4, 2011, at 11:24 AM, Kenneth Rohde Christiansen wrote: > Hey Oliver! > > If you are saying that device-pixel-ratio should include the user > scaling, then I can push that for Qt, but I would really like seeing > it supported by iOS as well for compatibility reasons. If you create a > bug

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
Hey Oliver! If you are saying that device-pixel-ratio should include the user scaling, then I can push that for Qt, but I would really like seeing it supported by iOS as well for compatibility reasons. If you create a bug for that, please cc me. Kenneth On Fri, Mar 4, 2011 at 8:11 PM, Oliver Hun

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Oliver Hunt
WebKit's canvas implementation has always scaled the backing buffer according to actual screen resolution, i suspect it doesn't pay any attention to zoom however :-/ Arguably that's a bug. --Oliver On Mar 4, 2011, at 10:08 AM, Charles Pritchard wrote: > In the future? > > > > On Mar 4, 20

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Charles Pritchard
In the future? On Mar 4, 2011, at 8:51 AM, Oliver Hunt wrote: > For reference desktop webkit implementations will automatically increase the > canvas backing store resolution as the device:css pixel ratio increases. > > --Oliver > > On Mar 4, 2011, at 1:44 AM, Charles Pritchard wrote: > >>

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Oliver Hunt
For reference desktop webkit implementations will automatically increase the canvas backing store resolution as the device:css pixel ratio increases. --Oliver On Mar 4, 2011, at 1:44 AM, Charles Pritchard wrote: > On 3/4/2011 1:35 AM, Kenneth Rohde Christiansen wrote: >> Hi again, >> >>> I'm t

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
> I haven't debugged with enough tablet devices, such as the color kindle, to > know how many webkit distros it works with. > What should I do about user zoom on the desktop (and possibly, the kindle) ? Well the value doesn't change with zooming on neither Safari nor Chrome. I am not sure about th

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Charles Pritchard
On 3/4/2011 1:35 AM, Kenneth Rohde Christiansen wrote: Hi again, I'm trying to keep the canvas bitmap at the same pixel resolution as the device, otherwise it is blurry. OK, I see. This, for example, works if the pixel ratio is 2. Yes, when the user has a zoom level set, I'd like to paint

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
Hi again, > I'm trying to keep the canvas bitmap at the same pixel resolution as the > device, > otherwise it is blurry. OK, I see. > This, for example, works if the pixel ratio is 2. > height="200"> > > Yes, when the user has a zoom level set, I'd like to paint to match the > pixel ratio, > s

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Charles Pritchard
On 3/4/2011 12:21 AM, Kenneth Rohde Christiansen wrote: Hi there, I do not exactly understand what you are trying to do (you want the canvas to cover the whole view?), but for me I'm trying to keep the canvas bitmap at the same pixel resolution as the device, otherwise it is blurry. This, for

Re: [webkit-dev] Canvas backing resolution

2011-03-04 Thread Kenneth Rohde Christiansen
Hi there, I do not exactly understand what you are trying to do (you want the canvas to cover the whole view?), but for me > This returns true, always, on non-mobile platforms, it seems: > window.matchMedia('(-webkit-min-device-pixel-ratio: 1)'); makes perfect sense on the desktop, as the conten

[webkit-dev] Canvas backing resolution

2011-03-03 Thread Charles Pritchard
Is there currently an accepted way within webkit to get the resolution which should be used for an HTML canvas backing store? Currently, on Mobile Safari and Android, I can use window.devicePixelRatio, on the desktop, I use window.outerWidth / window.innerWidth and on FF4, I use a big string of