[webkit-dev] GraphicsContext functionality needed for new border-radius drawing
bdakin at apple.com
Tue Jun 29 12:49:39 PDT 2010
Yesterday I committed a patch re-writing the way WebKit paints border-radius and fixed a bunch of bugs along the way. The new border-radius-painting mechanism involves a new function: GraphicsContext::clipConvexPolygon(). I have implemented this in GraphicsContextCG, but I did not implement it for other platforms since I don't have graphics expertise in the other APIs and since I don't have configurations to test all of the platforms.
To avoid breaking other implementations of border-radius in the meantime, I left the old border-radius-painting code path in the tree for the time being, wrapped with an ifdef. This is temporary though. We want to remove the old code path to avoid maintaining cruft. I would like to STRONGLY encourage other platforms to implement GraphicsContext::clipConvexPolygon() soon.
This is all you have to do to fix LOTS of border-radius bugs for your graphics platform of choice:
1. Implement GraphicsContext::clipConvexPolygon(). I suspect this will not be very hard. All platforms have an implementation of GraphicsContext::drawConvexPolygon() already, and hopefully the clipping function will be similar.
2. Fix #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING in RenderObject.h so that your platform opts into the new code path.
Here is a test-case that really illuminates all of the bugs we had in WebKit that will be fixed when you do this. (Move the sliders around and pretend they are labeled.)
Here are the bugs that I filed to track this issue on various platforms:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev