[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] How to set a canvas backing store to display units?



On Sat, Jun 16, 2012 at 10:30 PM, Gregg Tavares (çç) <gman@google.com> wrote:
It will break because you have to test. That's what I mean by automatic. Lots of programmers will add "allowHighRes" either by using a library, by copying boilerplate code or just by not understanding theÂimplications. They won't personally have an HD-DPI machine so their app will work. They'll have no idea of all the rules they broke. Hence, it will break automatically when put on an HD-DPI machine.Â

The exact same will be true for those same programmers who copy&paste or use an engine that does the window.devicePixelRatio for you, their apps will break if they are not aware that their canvas size != backing store size. The effort to make your app compatible is identical in either case, and the breakage is identical in either case as well. Both are an opt-in mechanism and both dismarry canvas dimensions from backingstore dimensions withoutÂnecessarilyÂthe average developer being aware of it. Even the educational effort is the same, I really don't think it matters. I also think I don't care:

Option #1: Slap Apple on the wrist never to do the automatic thing, and add an addendum to the specification stating that backingstore == canvas dimension and that devicePixelRatio has to be queryable for everybody who implements webgl
Option #2: add this "allow this or that" attribute
Option #3: allow both (that could get kinda confusing)