[OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer
Laurent Bourgès
bourges.laurent at gmail.com
Tue Aug 2 12:57:03 UTC 2016
Hi Jim,
A tip on webrevs, if you supply a file of filenames then you can tell it to
> diff a file with a name change against its former name by using 2 filenames
> on the same line, as in:
>
> --------
> filetodiff1.java
> filetodiff2.java
> filetodiff3.java filetodiff3oldname.java
> filetodiff4.java
> --------
>
Thanks for the tip, I made another webrev (for archive) that shows the
proper diffs in ArrayCache / ArrayCacheConst:
http://cr.openjdk.java.net/~lbourges/marlin/marlin-8159638.1_bis/
> In Renderer.java, you create the alphaLine and blkFlags refs as Clean, but
> then you always put them back using indices of (0, 0) so they will never
> actually be cleaned - is there a reason you don't just use a dirty ref
> there?
>
Both alphaLine and blkFlags arrays must be zero-filled as these arrays are
storing accumulated values:
- get an initial zero-filled array from a Clean Reference (new array and
Not Unsafe.allocateUninitializedArray)
- compute values (accumulators)
- copy data and reset dirty part of these arrays in copyAARowNoRLE() or
copyAARowRLE_WithBlockFlags() at every pixel row !
(iterate on all pixel rows)
- dispose: these arrays are already 'clean' i.e. zero-filled so I
explicitely skip the cleanup by indicating an empty dirty range:
alphaLine = alphaLine_ref.putArray(alphaLine, 0, 0); // already
zero filled
blkFlags = blkFlags_ref.putArray(blkFlags, 0, 0); // already zero
filled
It is not possible to use a dirty reference in this case as both allocated
and returned array may contain garbage data (from the IntArrayCache).
> Other than that question, I don't see any problems with the fix...
>
Ready to go ?
or I need another reviewer, phil ?
Cheers,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160802/7c1750df/attachment.html>
More information about the 2d-dev
mailing list