classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: RFC: Fixed array index in GdkGraphics2D.updateBufferedI


From: Sven de Marothy
Subject: [cp-patches] Re: RFC: Fixed array index in GdkGraphics2D.updateBufferedImage
Date: Tue, 14 Jun 2005 09:49:50 +0200

> 
> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]