| Summary: | The Graphics API issue on the eclipse 3.4M5 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Dazheng Gao <gump_gao> | ||||
| Component: | GEF-Legacy Draw2d | Assignee: | Marc Gobeil <mgobeil> | ||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ahunter.eclipse, hudsonr | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 3.5.0 (Galileo) | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
> When I add two RetangleFigure to the Layer, but one is the advace graphics, and
> the other is not.
What does this comment mean? Are you using the new LineAttributes API?
I suppose another question is why you are using 3.4M5 and not 3.4 GA or better 3.4.1? I don't use the LineAttributes.I new a figure, annf add two RetangleFigures to this figure.And do nothing. When the two RetangleFigures paint You will find one is the advace graphics, and the othe is not. Can you provide an example snippet? I write a test in the LEDFigure.Please download the attachment.Replace this class to the logic LEDFigure.Run the logic , add a LED to the diagram, you watch the print infomation, although the graphics is advanced, but the gc one is advanced, this othe is not. Created attachment 121753 [details]
The LEDFigure
Can you reproduce this in 3.4? The code you are suggesting rearranging is old and hopefully worked previously. Also, it provided a slight optimization. gef version or logic version? can you run my example, you can test it follow the code.You want to add two figure to a parent, and all setAlpha.you will find when paint the gc of the SWTGraphics is different advanced. Dazhen's definitely found something wrong here. Using his test, I can trace it to a point in SWTGraphics.checkGC(), the second fillShape() call from LEDFigure, where the applied state and current state hints match (suppressing the call to reconcileHints()), but the gc's advanced state doesn't match what's in the current state hint. Will continue to dig deeper... (In reply to comment #0) > The other issure is when the graphics is advanced and the XORMode is true and > the alpha is 255, In the GC class, maybe the native method > Gdip.Graphics_FillRectangle has some issures. Is not same to the no adavaced > graphics. The alpha is not use and the background is black(The background color > is not use).(See method of fillRectangle GC class ) > Bug 262797 addresses the XORMode issue by setting Shape into non-advanced mode when drawing XOR fill/outline. It turns out XORMode is a non-advanced only feature, and has been deprecated in SWT due to lack of support on all platforms (most notably Mac OSX). GEF's api doesn't reflect this deprecation of the underlying function, but probably should. I think this can be resolved, right Marc? (In reply to comment #11) > I think this can be resolved, right Marc? > yeah, it's effectively a duplicate of Bug 262797. *** This bug has been marked as a duplicate of bug 262797 *** |
When I add two RetangleFigure to the Layer, but one is the advace graphics, and the other is not. Look like the reconcileHints methos of the SWTGraphics is error, if ((changes & ADVANCED_GRAPHICS_MASK) != 0) { if ((hints & ADVANCED_GRAPHICS_MASK) != 0 && !gc.getAdvanced()) gc.setAdvanced(true); should move before if (changes == 0) return; The other issure is when the graphics is advanced and the XORMode is true and the alpha is 255, In the GC class, maybe the native method Gdip.Graphics_FillRectangle has some issures. Is not same to the no adavaced graphics. The alpha is not use and the background is black(The background color is not use).(See method of fillRectangle GC class )