Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » new Image(getDisplay(), screenImage.getImageData()) performance
new Image(getDisplay(), screenImage.getImageData()) performance [message #465409] Mon, 12 December 2005 20:59 Go to next message
Eclipse UserFriend
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
Re: new Image(getDisplay(), screenImage.getImageData()) performance [message #465411 is a reply to message #465409] Mon, 12 December 2005 21:08 Go to previous message
Billy Biggs is currently offline Billy BiggsFriend
Messages: 94
Registered: July 2009
Member
F lacou wrote:
> 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 ?

Maybe this is better discussed in a bug report with a
more complete snippet. However, is it the getImageData()
or the new Image() which is slow? What is screenImage?

I suspect the performance difference you're seeing may
be due to whether screenImage is in video RAM or not.
Copying data from the video card back to system memory
can be slow.

-Billy
Previous Topic:SWT bug?
Next Topic:RE: Re: ErrorDialog and IStatus
Goto Forum:
  


Current Time: Sat Dec 14 14:35:21 GMT 2024

Powered by FUDForum. Page generated in 0.02539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top