[OpenJDK 2D-Dev] RFC: 7019861 + workaround + minor optimization
james.graham at oracle.com
Mon Mar 7 21:20:56 UTC 2011
On 3/4/2011 3:40 PM, Denis Lila wrote:
> Hi Jim.
>> line 52: and => or?
> No, because our ranges are half open, so if lastCrossing == end,
> that means the line ends just before end and hence doesn't cross it.
Forgive my ascii art shorthand, "=>" was supposed to be an arrow, not a
comparison operator. I was saying that you use the word "and" on that
line and it should be changed to the word "or" because a non-compliant
edge can be invalid by violating either (i.e. "or") condition. In other
"and" ===should be===>>>> "or"
Also, in rereading it, you talk about the edges crossing outside of the
range but my brain immediately goes to the fact that when they first
came in they may have had huge extents, but they were then clipped.
Perhaps it would be better to use the term "edge fragment stored in the
edges array" or "clipped edge". Also, the word "cross" is a little
overloaded. What about:
// Preconditions: Only subpixel scanlines in the range
// (start <= subpixel_y <= end) will be evaluated. No
// edge may have a valid (i.e. inside the supplied clip)
// crossing that would be generated outside that range.
>> Is this blocking anyone until they find the Hotspot problem?
> Not to my knowledge, but it has been very annoying when running
> some of my own tests.
Just curious if the "final" attribute on local variables might be
causing it problems?
>> line 535: Would it work to use pminY and pmaxY? Will there be any
>> active edges to iterate outside of that range?
> I'm not sure I understand. I do use pminY and pmaxY - just their
> subpixel versions. If we used pminY and pmaxY instead of subpix_pminY
> and subpix_pmaxY that would just mean we'd have to compute the subpixel
> versions in _endRendering (or ScanlineIterator.<init>).
I guess I meant the spmin/maxY. The pmin/maxY have been rounded out to
the next full pixel boundary and then you convert back to sub-pixel
precision, but in doing so you then force the iterator to iterate
through any subpixel positions before spminY and after spmaxY. This is
probably in the noise for any but the smallest shapes, but still - isn't
it wasted effort?
More information about the 2d-dev