Apache OpenOffice (AOO) Bugzilla – Issue 102109
Transparent graph lines are not antialiased
Last modified: 2017-05-20 11:41:53 UTC
Setting a line graph to semi-transparent, will be correctly antialiased when editing but then displayed with NO edge smoothing when viewed without editing. 1. Enter some values in three rows (1,2,3, etc.) 2. Select cells and plot a line graph. 3. Exit graph editing. Graph should appear identical before and after. 4. Edit graph and change line properties to 5% transparent. 5. While editing graph line displayed correctly with antialiased edge. 6. Exit editing the graph. The line is now displayed differently with no smoothing. This effects all lines plotted on graphs. Regards Andrew
Created attachment 62399 [details] Graph showing line with and without antialised edge due to transparency
I can only reproduce, if i switch back from 3D to 2D graph. IHA, pls have a look.
@aw, this is your area I think.
AW: Added to CWS aw075, taking a look. The difference between activated and non-activated chart is that the latter uses a MetaFile to paint. Ckecking which actions are used to do that...
AW: It's not a thick line in the MetaFile; MetaFiles do not support transparent line drawing; it's a (actually two, one for the ledgend) MetaFloatTransparentAction. It opens a buffer-VDev and the lines are not as lines in the MetaFile, but as filled PolyPolygons. That's the problem with MetaFiles: They are a PAINT RECORDING, not a scene graph. Ahhh :-( To make this work with AA, the OutputDevice::DrawTransparent methods (there are two; one with a gradient and one with a percentage transparency) need rework. This will be some stuff to do. More and more work surfaces from the fact that MetaFiles need to be used for inactivated OLE visualisations. Maybe we should think again about using primitives in some savable/loadable form for at least our own OLEs...
AW: Checking OutputDevice::DrawTransparent (the TransparenceGradient version). The AntiAliasing state is not copied from the current OutDev when the buffer-VDev is created. After adding, the AA Polygon painters are used. The result is corrupted by pVDev->DrawMask(...) (...) where the previously painted mask is added to the VDev. Need to debug DrawMask and check if it can be made working wit alpha, too...
AW: Created extra code for OutputDevice::DrawTransparent which will do extra stuff when AA is on. Instead of trying to create a mask (which would involve mixing the alpha-based mask with the gradient as mask) it does what the VclPrimitiveRenderer does: Copy from source, draw to it, create alpha using the gradient and copy back. This is still tricky stuff due to all the MapModes, offsets and pixel/logic values involved. Works now and fixes this current case. Doing some more testst with this solution...
AW: Works well and is good for now. It shows the necessity to implement a decomposition for MetaFile primitive and to paint MetaFiles using the primitive renderers in the future. Checked in, done.
AW: Need to use AlphaMask instead of Bitmap for aAlpha. Changed, commited.
AW->WG: Please review as described
AW: Adapted target to 3.2
Verified in CWS.