[webkit-dev] Antialiasing GraphicsContext::drawLine

2010-03-13 Thread Sausset François
I recently began to work on the square root implementation in MatML and I'm 
near to submit a patch.
But as I'm new to WebKit development, I have a beginner question:

To draw the square root, the GraphicsContext::drawLine method is called but it 
is written (in comments) to use it only for borders.
Moreover this method enforces to turn antialiasing off.
I have two possibilities:
- modify that method to allow (optional) antialising
- use other methods. It should be better but I don't know which one is adapted.
Ideally, a polyline method should be great. Is there such a method? Probably 
yes, as SVG  Canvas need advanced drawing.
Any help is welcome!

Thanks in advance,

François Sausset


Le 18 févr. 2010 à 19:38, Alexey Proskuryakov a écrit :

 
 Your question is not about WebKit development, so it should be directed to 
 webkit-help mailing list. I've answered below, but please choose a correct 
 e-mail list in the future.
 
 Please note that linking directly to WebCore is most definitely unsupported 
 and extremely fragile. One should always be using platform-specific WebKit 
 APIs.
 
 On 17.02.2010, at 18:27, Steve Hanna wrote:
 
 136 WebCore::XPathResult* xpr = doc-evaluate(query,
 dynamic_castWebCore::Node*(doc), NULL,
 
 
 The XPathResult object is destroyed at this point, so the rest of the code 
 operates on freed memory. One needs to keep the reference in RefPtr. Also, 
 you don't need dynamic_cast when downcasting - and we build WebCore with RTTI 
 disabled anyway.
 
 RefPtrWebCore::XPathResult xpr = doc-evaluate(query, doc, 0, 
 WebCore::XPathResult::UNORDERED_NODE_ITERATOR_TYPE, NULL, ec);
 
 - WBR, Alexey Proskuryakov
 
 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Antialiasing GraphicsContext::drawLine

2010-03-13 Thread Dan Bernstein

On Mar 13, 2010, at 9:06 AM, Sausset François wrote:

 I recently began to work on the square root implementation in MatML and I'm 
 near to submit a patch.
 But as I'm new to WebKit development, I have a beginner question:
 
 To draw the square root, the GraphicsContext::drawLine method is called but 
 it is written (in comments) to use it only for borders.
 Moreover this method enforces to turn antialiasing off.
 I have two possibilities:
 - modify that method to allow (optional) antialising
 - use other methods. It should be better but I don't know which one is 
 adapted.
 Ideally, a polyline method should be great. Is there such a method? Probably 
 yes, as SVG  Canvas need advanced drawing.
 Any help is welcome!

You can construct a Path object, use the path methods to add a line (or lines) 
and then use GraphicsContext::beginPath(), GraphicsContext::addPath() and 
GraphicsContext::strokePath().___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev