[OpenJDK 2D-Dev] X11 uniform scaled wide lines and dashed lines; STROKE_CONTROL in Pisces
Jim Graham
james.graham at oracle.com
Wed Oct 13 23:20:29 UTC 2010
Hi Denis,
I took a little break from code reviewing to write up this concept which
might help simplify the PolyIOHelper stuff in your code (later). My
concept was that the attached "transforming PathConsumer" classes would
be potentially more efficient than putting the coordinates into a buffer
and then calling a method on AffineTransform. With the PolyIOHelper
stuff we have the following flow:
src calls pc.fooTo()
pc calls io.readFoo()
io stores to buffer
conditionally:
io calls at.transform()
at loads values
at computes values
at stores values
With these classes, if there is a transform:
src calls tpc.fooTo(x,y)
tpc computes values
tpc calls pc.fooTo(x',y')
pc stores to buffer as needed
And if the transform was null or identity:
src calls pc.fooTo()
pc stores to buffer as needed
And something similar on the output. The buffering is then entirely at
the discretion of the eventual consumer (Dasher/Stroker) and the
information flow is more direct whether or not there is a transform.
There are optimal "TPC" implementations of translate, scale+translate,
and full transform. AT further optimizes the cases of scale without
translate and shears without scales (and/or translates), but I don't
think those cases happen often enough to worry about spending too much
to optimize, especially since these classes already win by inlining the
transform calculations...?
Note that these compile, but I haven't tested them (the implementation
was pretty straightforward, though)...
...jim
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TransformingPathConsumer2D.java
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20101013/5978e0c8/TransformingPathConsumer2D.java>
More information about the 2d-dev
mailing list