> 
> The fix makes sense to me however I would prefer to see this like:
>           int width = bimage.getWidth();
>           int index = 0;
>           for (int y = 0; y < height; ++y)
>             for (int x = 0; x < width; ++x)
>              bimage.setRGB(x, y, pixelBuffer[index++]);
> 
> Doing a multiplication and addition on every iteration seems quite
> wasteful to me :)
> 

Doing a pixel-by-pixel copy and conversion on EVERY DRAWING OPERATION is
quite wasteful as well. :-/ Really, let's keep our priorities in order
here :)

This code is one of the absolutely worst parts of Classpath and I plan
to replace it completely later. The idea is the BufferedImage should be
re-engineered to use native buffers on which Cairo can draw to directly.
My plan:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20630

/Sven



_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to