Canvas performance on Mac OS
james.graham at oracle.com
Mon Mar 30 19:26:00 UTC 2015
On 3/30/15 12:04 PM, Jim Graham wrote:
> drawPolygon() is a very complex operation that involves things like:
> - dealing with only rendering common points of intersection once
An example of the distinction here - try a test case where you execute
the exact same diagonal line primitive 1,000 times on top of itself
(identical coordinates for all of them).
Then change the example to use a Polygon that goes from point A to point
B and back, over itself 1,000 times.
The result of all of those lines will have jagged edges even though the
lines themselves are antialiased because the partially filled pixels
along the edges slowly accumulate opacity until their carefully blended
edges get lost in the accumulated error.
The result of the polygon will be identical to just drawing an
antialiased line from point A to point B because it is turned into a
single coverage result by the software rasterizer.
Another similar example - set an opacity of 0.1 on all of those
rendering calls. The (multi-)drawLine example will look like an opaque
line of 1.0 opacity, but the polygon will still look like it has an
opacity of 0.1 because the coverages are accumulated across the entire
polygon before any rendering occurs and so each pixel is only blended
More information about the openjfx-dev