Apache OpenOffice (AOO) Bugzilla – Issue 106379
Gradient fill of ellipse extends outside thin border in metafile
Last modified: 2010-01-19 12:18:02 UTC
The bugdoc contains ellipses with a thin border and a gradient fill. When converted to a metafile, single pixels of the fill can be visible outside of the border (depending on size and scale). With a light gradient and dark background these pixels can be somewhat distracting. It can be a problem with bubble charts, which contain many ellipses and are rendered into a metafile.
Created attachment 65700 [details] Bugdoc
AW: It's (again, argh) a problem with Metafiles. It did not get more bad (thus it's in principle not a regression or a defect), but just is not AntiAliased. Metafiles are simply not prepared for Antialiased actions. The actions contained draw the gradient by using (the old and known) XOR painting trick to avoid the ClipRegion usage. This works, but unfortunately that XOR actions are contained in the Metafile to actually paint the gradient. Of course, a XOR action CAN NOT be Antialiased since it's pixel-oriented, thus a non-AAed visualisation is the result which may stick over the AAed object border. Someone later tried to add more info by encapsulating all these actions by a XGRAD_SEQ_BEGIN/XGRAD_SEQ_END and added a MetaGradientExAction which contains a PolyPolygon and the Gradient information. Some exporters use this to avoid the problem. I actually tried to catch the MetaGradientExAction in GDIMetaFile::Play (where it is too dangerous to do, ust for testing). This works partially. One problem is that when using the contained info and calling OutputDevice::DrawGradient(...) the same XOR paint is triggered. This means i would have to: - Write another renderer for Metafiles to not have that big change in GDIMetaFile::Play (the 11th MetaFile interpreter/renderer). - Rewrite OutputDevice::DrawGradient(...) to work in the AntiAliased case. A second problem is that the PolyPolygon in MetaGradientExAction does have no more bezier information; this is removed by purpose by subdivision since Polygon::GetBoundRect() does not work with beziers and asserts that case. Noone ever implemented this (!). All in all: All that fixes in the last time are nothing else than to try to 'fix' that VCL itself is not really prepared for AntiAliased rendering. I more and more tend to implement the decompose for the MetaFile primitive. When this is done, a Metafile could be rendered by convering it to primitives completely and send it over the primitive renderer which completely supports AntiAliasing. This would have many positive effects seen over a longer time period. Thinking about all the circumstances...
AW: #i106541# solves this problem, too (as expected).
AW: Adapted target
AW: Checked in installed build, works as expected.
AW->WG: Please review.
Verified in CWS.
AW: Closing.