<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I don't think a totally different context is a good idea. Sometimes you want to mix antialiased and non-antialiased modes.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>The API in CG is part of the graphics state...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>CGContextSetShouldAntialias</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I don't think an API like this should be vague about what it's doing... e.g., just using vague terms like "quality." We should say what we mean... antialiasing for example.</DIV><DIV>dave</DIV><DIV><BR><DIV><DIV>On Oct 20, 2006, at 10:01 PM, Andrew Fedoniouk wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><FONT face="Arial" size="2"></FONT> </DIV><BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><DIV style="FONT: 10pt arial; font-family: arial; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; ">----- Original Message -----</SPAN></DIV><DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black; font-family: arial; font-size: 13.3333px; "><B style="font-family: arial; font-size: 13.3333px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; font-weight: bold; ">From:</SPAN></B><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "> </SPAN><A title="canvasgame@gmail.com" href="mailto:canvasgame@gmail.com"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); font-family: arial; font-size: 13.3333px; -khtml-text-decorations-in-effect: underline; ">Benjamin Joffe</SPAN></A><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "></SPAN></DIV><DIV style="FONT: 10pt arial; font-family: arial; font-size: 13.3333px; "><B style="font-family: arial; font-size: 13.3333px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; font-weight: bold; ">To:</SPAN></B><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "> </SPAN><A title="whatwg@whatwg.org" href="mailto:whatwg@whatwg.org"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); font-family: arial; font-size: 13.3333px; -khtml-text-decorations-in-effect: underline; ">whatwg@whatwg.org</SPAN></A><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "></SPAN></DIV><DIV style="FONT: 10pt arial; font-family: arial; font-size: 13.3333px; "><B style="font-family: arial; font-size: 13.3333px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; font-weight: bold; ">Sent:</SPAN></B><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "> Friday, October 20, 2006 9:09 PM</SPAN></DIV><DIV style="FONT: 10pt arial; font-family: arial; font-size: 13.3333px; "><B style="font-family: arial; font-size: 13.3333px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; font-weight: bold; ">Subject:</SPAN></B><SPAN class="Apple-style-span" style="font-family: arial; font-size: 13.3333px; "> [whatwg] Canvas draw quality</SPAN></DIV><DIV><FONT face="Arial" size="2"></FONT><BR></DIV><DIV>I would like to see a property added to the 2d canvas context that would allow quality to be lowered for drawing functions. Normally any time a shape is drawn, pixels close to the boundary are made semi transparent to make it look smooth, this is usually favourable but I have had a need to draw shapes and lines with pixel sharp boundaries in the same way as Java normally does. I would imagine that with the setting enabled, only the integer part of linewidth would be used. This setting would also affect drawing images, making them have no blurring or approximating when scaled or rotated.<SPAN class="Apple-converted-space"> </SPAN><BR><BR>This could easily be implemented without affecting old scripts, making a property such as lowQuality = true; (default false). Or perhaps allowing more control: a float from 0 (low quality) to 1 (high quality), and interperating null as 1 for backwards compatibility.<SPAN class="Apple-converted-space"> </SPAN><BR><BR>This property could also be handy in instaces where both fill() and stroke() are being called. Low quality could be used on the fill() to improve performace while stroke() could be used with high quality so it still draws smoothly.</DIV><DIV><FONT face="Arial" size="2"></FONT> </DIV></BLOCKQUOTE><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">I think that the best way is just to define different values for the context ID:</SPAN></FONT></DIV><PRE style="white-space: pre; ">DOMObject <A href="http://www.whatwg.org/specs/web-apps/current-work/#getcontext"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; white-space: pre; ">getContext</SPAN></A>(in DOMString contextID);</PRE><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">Something like "2D" and "2D-fast" or "2D-simple".</SPAN></FONT></DIV><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">Another option would be to add one optional parameter to the getContext() function.</SPAN></FONT></DIV><DIV><FONT face="Arial" size="2"></FONT> </DIV><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">I doubt that someone will need to switch it in the middle of drawing so</SPAN></FONT></DIV><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">having such switch as an attribute is redundant.</SPAN></FONT></DIV><DIV><FONT face="Arial" size="2"></FONT> </DIV><DIV><FONT face="Arial" size="2"><SPAN class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">Andrew Fedoniouk.</SPAN></FONT></DIV><DIV><FONT face="Arial" size="2"><A href="http://terrainformatica.com"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); font-family: Arial; font-size: 10px; -khtml-text-decorations-in-effect: underline; ">http://terrainformatica.com</SPAN></A></FONT></DIV><DIV><FONT face="Arial" size="2"></FONT> </DIV><DIV><FONT face="Arial" size="2"></FONT> </DIV><DIV><BR></DIV><BR class="Apple-interchange-newline"></SPAN></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>