Community
Participate
Working Groups
From time to time all ScalableImageFigures based on the same SVG image are substituted by empty 8x8 figure on my diagrams. Instead of actual figures I can see transparent figures, by looking into the code I found these figures are displaying empty SWT images 8x8 pixels each. Usually re-execution of whole Eclipse instance helps. SWT 8x8 images are created in SVGImage.renderImage();, last "catch" block, but looks like the reason of this problem is not in SVGImage implementation. AFAIU, SVGImage is statefull and can (should) be correctly rendered only from one thread. In the same time I can see concurrent calls to the SVGImage.renderImage() method from different threads. Simple workaround for this problem is to make whole method AbstractRenderedImage.getSWTImage() synchronized. Several threads are created and executed for the same srcImage instance in: RenderHelper.renderSWTImage().
Created attachment 92459 [details] Patch solving the problem by introducing synchronization
Another (better) solution for this situation Is to not execute unnecessary second rendering thread at all. This patch should be a little bit more complex and in this case renderSWTImage() method should be corrected. Nevertheless, looks like attached patch should be applied too because AFAIU at least SVGImage.renderImage() method supposed to be called from one thread only.
[GMF Restructure] Bug 319140 : product GMF and component Runtime was the original product and component for this bug
This problem leads not only to incorrect rendering it also produces SWT errors. See stack trace from eclipse 3.6.1: java.lang.NullPointerException at org.eclipse.swt.graphics.Image.createGdipImage(Image.java:876) at org.eclipse.swt.graphics.GC.drawImage(GC.java:949) at org.eclipse.swt.graphics.GC.drawImage(GC.java:943) at org.eclipse.draw2d.SWTGraphics.drawImage(SWTGraphics.java:417) at org.eclipse.gmf.runtime.draw2d.ui.render.internal.RenderHelper.drawRenderedImage(RenderHelper.java:148) at org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics.drawRenderedImage(RenderedMapModeGraphics.java:83) at org.eclipse.gmf.runtime.draw2d.ui.render.internal.RenderHelper.drawRenderedImage(RenderHelper.java:136) at org.eclipse.gmf.runtime.draw2d.ui.render.figures.ScalableImageFigure.paintFigure(ScalableImageFigure.java:380)