Ideal GEF Viewer eats up CPU [message #486533] |
Fri, 18 September 2009 04:43 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have a GEF viewer with large figure,
And an associated outline view for the same,
With outline view the application eats up cpu even while minimized,
Without outline view the application starts eating CPU once in focus with
no user activity,
Is this right,
How can i find out what is eating the CPU,
a break point position in GEF or draw2d classes would be appreciated...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Re: Ideal GEF Viewer eats up CPU [message #486541 is a reply to message #486533] |
Fri, 18 September 2009 06:46 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
vijay wrote:
> Hi,
> I have a GEF viewer with large figure,
> And an associated outline view for the same,
> With outline view the application eats up cpu even while minimized,
outline view thumbnail updater runs continuously, even when application is
minimized is this right???
> Without outline view the application starts eating CPU once in focus with
> no user activity,
I solved the above problem,This problem was because of
figure.setBackground calls in painFigure method,the setBackground should
be called on graphics instance not on figure instance.
(Hope this would help others)
> Is this right,
> How can i find out what is eating the CPU,
> a break point position in GEF or draw2d classes would be appreciated...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Re: Ideal GEF Viewer eats up CPU [message #486808 is a reply to message #486541] |
Sat, 19 September 2009 11:48 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Why does the ThubmnailUpdater of Thumbnail class update the image title by tile...
Is there a reason for this type of update...
In the run method..
public void run() {
if (!isActive() || !isRunning())
return;
int v = getCurrentVTile();
int sy1 = v * tileSize.height;
int sy2 = Math.min((v + 1) * tileSize.height, getSourceRectangle().height);
int h = getCurrentHTile();
int sx1 = h * tileSize.width;
int sx2 = Math.min((h + 1) * tileSize.width, getSourceRectangle().width);
org.eclipse.draw2d.geometry.Point p = getSourceRectangle().getLocation();
Rectangle rect = new Rectangle(sx1 + p.x, sy1 + p.y, sx2 - sx1, sy2 - sy1);
thumbnailGraphics.pushState();
thumbnailGraphics.setClip(rect);
thumbnailGraphics.fillRectangle(rect);
sourceFigure.paint(thumbnailGraphics);
thumbnailGraphics.popState();
if (getCurrentHTile() < (hTiles - 1))
setCurrentHTile(getCurrentHTile() + 1);
else {
setCurrentHTile(0);
if (getCurrentVTile() < (vTiles - 1))
setCurrentVTile(getCurrentVTile() + 1);
else
setCurrentVTile(0);
}
if (getCurrentHTile() != 0 || getCurrentVTile() != 0)
Display.getCurrent().asyncExec(this);
else if (isDirty()) {
setDirty(false);
Display.getCurrent().asyncExec(this);
repaint();
} else {
stop();
repaint();
}
}
for every single tile update a async exec is called...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Powered by
FUDForum. Page generated in 0.06701 seconds