<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY
style="WORD-WRAP: break-word; khtml-nbsp-mode: space; khtml-line-break: after-white-space"
bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dave, v</FONT><FONT face=Arial size=2>arious
implementations use different libraries/approaches for the
Graphics.</FONT></DIV>
<DIV><FONT face=Arial size=2>Way of tuning parameters and their set can be
different. I think that it is simply not possible</FONT></DIV>
<DIV><FONT face=Arial size=2>to generalize them all. </FONT><FONT face=Arial
size=2>At least something generic like preference=quality/speed switch makes
real sense.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Technically it is better to allow to get two
Graphics instances for the same canvas and use </FONT></DIV>
<DIV><FONT face=Arial size=2>them at the same time if really needed. In any
case 2D and 3D graphics shall coexist on the same
surface. </FONT></DIV>
<DIV><FONT face=Arial size=2>So why not 2D and 2D-fast ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In any case it is up to UA to provide multiple
implementation for different values of contextID.</FONT></DIV>
<DIV><FONT face=Arial size=2>contextID as a string is there in purpose I belive.
That is the one.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Andrew Fedoniouk.</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://terrainformatica.com">http://terrainformatica.com</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=hyatt@apple.com href="mailto:hyatt@apple.com">David Hyatt</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=news@terrainformatica.com
href="mailto:news@terrainformatica.com">Andrew Fedoniouk</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=canvasgame@gmail.com
href="mailto:canvasgame@gmail.com">Benjamin Joffe</A> ; <A
title=whatwg@whatwg.org href="mailto:whatwg@whatwg.org">whatwg@whatwg.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, October 20, 2006 10:12
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [whatwg] Canvas draw
quality</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>I
don't think a totally different context is a good idea. Sometimes you
want to mix antialiased and non-antialiased modes.
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR
class=khtml-block-placeholder></DIV>
<DIV>The API in CG is part of the graphics state...</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><BR class=khtml-block-placeholder></DIV>
<DIV>CGContextSetShouldAntialias</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><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><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><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="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px 0px; khtml-text-decorations-in-effect: none; apple-text-size-adjust: auto; orphans: 2; widows: 2">
<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: 13px arial"><SPAN class=Apple-style-span
style="FONT-SIZE: 13px; FONT-FAMILY: arial">----- Original Message
-----</SPAN></DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 13px arial; font-color: black"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial"><SPAN
class=Apple-style-span
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial">From:</SPAN></B><SPAN
class=Apple-style-span style="FONT-SIZE: 13px; FONT-FAMILY: arial">
</SPAN><A title=canvasgame@gmail.com
href="mailto:canvasgame@gmail.com"><SPAN class=Apple-style-span
style="FONT-SIZE: 13px; COLOR: rgb(0,0,238); FONT-FAMILY: arial; khtml-text-decorations-in-effect: underline">Benjamin
Joffe</SPAN></A><SPAN class=Apple-style-span
style="FONT-SIZE: 13px; FONT-FAMILY: arial"></SPAN></DIV>
<DIV style="FONT: 13px arial"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial"><SPAN
class=Apple-style-span
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial">To:</SPAN></B><SPAN
class=Apple-style-span style="FONT-SIZE: 13px; FONT-FAMILY: arial">
</SPAN><A title=whatwg@whatwg.org href="mailto:whatwg@whatwg.org"><SPAN
class=Apple-style-span
style="FONT-SIZE: 13px; COLOR: rgb(0,0,238); FONT-FAMILY: arial; khtml-text-decorations-in-effect: underline">whatwg@whatwg.org</SPAN></A><SPAN
class=Apple-style-span
style="FONT-SIZE: 13px; FONT-FAMILY: arial"></SPAN></DIV>
<DIV style="FONT: 13px arial"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial"><SPAN
class=Apple-style-span
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial">Sent:</SPAN></B><SPAN
class=Apple-style-span style="FONT-SIZE: 13px; FONT-FAMILY: arial">
Friday, October 20, 2006 9:09 PM</SPAN></DIV>
<DIV style="FONT: 13px arial"><B
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial"><SPAN
class=Apple-style-span
style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: arial">Subject:</SPAN></B><SPAN
class=Apple-style-span style="FONT-SIZE: 13px; FONT-FAMILY: arial">
[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-SIZE: 10px; FONT-FAMILY: Arial">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); WHITE-SPACE: pre; khtml-text-decorations-in-effect: underline">getContext</SPAN></A>(in DOMString contextID);</PRE>
<DIV><FONT face=Arial size=2><SPAN class=Apple-style-span
style="FONT-SIZE: 10px; FONT-FAMILY: Arial">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-SIZE: 10px; FONT-FAMILY: Arial">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-SIZE: 10px; FONT-FAMILY: Arial">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-SIZE: 10px; FONT-FAMILY: Arial">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-SIZE: 10px; FONT-FAMILY: Arial">Andrew
Fedoniouk.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><A href="http://terrainformatica.com"><SPAN
class=Apple-style-span
style="FONT-SIZE: 10px; COLOR: rgb(0,0,238); FONT-FAMILY: Arial; 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></BLOCKQUOTE></BODY></HTML>