new Image(getDisplay(), screenImage.getImageData()) performance [message #465409] |
Mon, 12 December 2005 20:59 |
Eclipse User |
|
|
|
Originally posted by: lacougarbage.yahoo.ca
Hi all,
We have an application that uses a SWT Canvas on which we use
GC.drawFocus() on each paint event. Here is the code:
<code>
addPaintListener(new PaintListener() {
public void paintControl(final PaintEvent event) {
Image finalimage = new Image(getDisplay(),
screenImage.getImageData());
GC newGC = new GC(screenImage);
newGC.drawFocus(...);
gc.drawImage(screenImage, 0, 0); // gc is from the paintEvent
finalImage.dispose();
});
</code>
screenImage is the original image
finaleImage is the image to draw to focus on.
On some celeron machines (2.4Ghz for exemple), we have response times of
about 45 ms per paint event which is fine but as we grow the image after
a resize the response time slows down abrubptly to about 300 ms per
paint which is totally unacceptable for our application. We don't
experience this behavior on p4 machines (2.8 and up), but changing the
customer's computers is not an option.
We tried various tricks to get rid of the finalImage and write directly
to the original screenimage, but it complexifies the application quite a
lot. (Since it's the new Image(getDisplay(),
screenImage.getImageData()) that is the faulty line)
Any idea of what we could do to speed up the app ?
Francois Lacoursiere
|
|
|
|
Powered by
FUDForum. Page generated in 0.02539 seconds