Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 380949

Summary: [GEF] RAP repaints the whole SWT canvas on any update
Product: [RT] RAP Reporter: Xihui Chen <chenxihui1981>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: tbuschto
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Xihui Chen CLA 2012-05-29 15:17:06 EDT
Build Identifier: RAP 1.5.0.20120521-1618

When I was monitoring the network traffic of my GEF application on RAP, I found that even a repaint on a small figure in GEF editor will also transfer the painting info for all other figures in the editor even they don't need to be updated at all. I think this is big problem since it will heavily affect the GEF performance on RAP.

Looks like the reason is that in RAP the redraw() method of swt.widgets.Control/Canvas ignored the rectangle region and just redraw the whole control whenever it is needed:

public void redraw( int x, int y, int width, int height, boolean all ) {
checkWidget();
if( width > 0 && height > 0 ) {
internalSetRedraw( true );
}
}




Reproducible: Always
Comment 1 Tim Buschtoens CLA 2012-05-30 10:52:09 EDT
The Canvas is currently not able to redraw only parts of the area due to browser-limitations. There are several possible solutions to this, but none are flawless or easy to implement.
Comment 2 Xihui Chen CLA 2012-05-30 12:27:08 EDT
HTML5 Canva has a method clearRect(x,y,w,h). Is that possible to pass the redraw area to it, and then in draw2d, only repaint the figures in this area?

(In reply to comment #1)
> The Canvas is currently not able to redraw only parts of the area due to
> browser-limitations. There are several possible solutions to this, but none are
> flawless or easy to implement.
Comment 3 Tim Buschtoens CLA 2012-05-31 05:33:43 EDT
No, because 
a) it still requires clipping to work properly
b) its not available in IE7 and 8 (neither clipping not clearRect)

If there were a simple solution to this, we would already have implemented it.
I'm not saying there is no solution at all, but none that can be implemented in just a few days.
Comment 4 Ivan Furnadjiev CLA 2016-02-25 08:39:46 EST

*** This bug has been marked as a duplicate of bug 423952 ***