|
|
|
Created:
13 years, 3 months ago by robkroeger Modified:
13 years, 2 months ago Reviewers:
rsc CC:
rsc, codebot Visibility:
Public. |
Patch Set 1 #Patch Set 2 : With environment variable control and manual page adjustment #
Total messages: 11
|
robkroeger
|
13 years, 3 months ago (2012年10月04日 00:20:24 UTC) #1 | |||||||||||||||||||||||
This is a first-crack at making devdraw support the retina macbook display by letting p9p apps use retina devices at the pixel resolution. Please take a look.
I don't have anything to try this on. Do you mean that this makes the app run at the actual hw pixel resolution (so it will appear smaller) or something else? Perhaps we need to let users choose?
On 2012年10月05日 21:21:47, rsc wrote: > I don't have anything to try this on. Any mac with a big screen can be coerced into "retina" mode with the quartz debug tool (http://osxdaily.com/2012/01/12/enable-hidpi-mode-in-mac-os-x-lion/) > Do you mean that this makes the app run at > the actual hw pixel resolution (so it will appear smaller) or something else? > Perhaps we need to let users choose? Yes. It makes devdraw use physical pixels so fonts and other drawing look tiny without other measures. (Like doubling the size of -font when running acme.) Cursors continue to be scaled by the operating system so have the right size regardless. This change has no effect when run on a non-retina devices and successfully handles dragging windows from retina to non-retina display. I see your point about letting users choose. I'm not sure how to do this -- or more accurately -- I'm not sure which way this choosing should be enabled that is not either a massive CL (which I would be happy to try to write albeit in stages) or somehow icky. Do you have a suggestion? Perhaps an environment variable? I could add this. One possible "high road" way would be to do this patch and then add more: * Make the device scale factor be an attribute of an Image object. A fragment of code that is retina-unaware would have its output pixel doubled. A fragment of code that is retina-aware would inform a draw-target Image of this awareness. So existing code would keep looking like it does now. * Make libframe retina-aware so it would draw fonts with glyph images and metrics in physical pixel sizes. I went through this process on Chrome and the text layout code has to either be pixel doubled (and look fuzzy) or operate in pixel-layout precision (and look gorgeous) or else the glyphs line-break/position wrongly.
A general complicating factor is that our best fonts are fixed sizes
and are probably too small for the retina display at native
resolution. However, I certainly would like to get something like this
into the tree for those who want to adjust things like font size. How
about disabling it by default but enabling if
atoi(getenv("devdrawretina")) > 0?
Thanks.
Russ
On 2012年10月08日 15:28:26, robkroeger wrote: Please take another look? I added the environment variable to control retina mode.
Thanks! Sorry, was away from mail for a few days.
Builds fine on my Mountain Lion and whatever-was-before-that Macs.
LGTM
*** Submitted as http://code.google.com/p/plan9port/source/detail?r=c1233acdb9a4 *** devdraw: MacBook retina support Enable with export devdrawretina=1 (everything will be smaller). R=rsc CC=plan9port.codebot http://codereview.appspot.com/6592072 Committer: Russ Cox <rsc@swtch.com>