Re: Tests for improvement in rendering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomaž,

your dump works in principle. I can read the xml-file and build the assertXPath.

For example, I am able to write a test about the material properties 'specular' and 'specularIntensity' of an object. Such is needed to verify correct values in case of material 'Metal'.

But while creating a test about material 'Matte', I have seen this problem:
The method createNewSdrLightingAttribute() in /core/svx/source/sdr/primitive2d/sdrattributecreator.cxx collects the lights. But it does not record, which light it is. So in my case the dump writes e.g.

<lights>
<light color="#aaaaaa" directionVectorX="0" directionVectorY="0" specular="1"/> <light color="#383838" directionVectorX="0" directionVectorY="0" specular="0"/> <light color="#464646" directionVectorX="0" directionVectorY="0" specular="0"/>
<lights>

I cannot see which lights they are.
The old wrong solution has used light 1, light 2 and light 3.
The new working solution uses light 2, light 3 and light 4.

I would need to test, that light 1 (which is always a spot light) is not used. Using light 1 had produced the error, that the appearance was not 'Matte'.

I could test, that the third color has the correct value, but that would only test indirectly, what the fix does. Shall I do it nevertheless?

Kind regards,
Regina



Tomaž Vajngerl schrieb am 08.11.2021 um 16:33:
Hi Regina,

On Fri, Nov 5, 2021 at 10:01 AM Tomaž Vajngerl <quikee@xxxxxxxxx <mailto:quikee@xxxxxxxxx>> wrote:

    Hi Regina,

    I guess rendering the shape to primitives and then dumping the
    primitives to an xml and asserting the values should do it, however
    the Primitive2dXmlDump will probably need to be extended for 3D
    primitives. I'll try to make a test that will cover some of the
    rendering aspects for fontworks.


I have extended the Primitive2dXmlDump [1] so it also should be able to dump 3D primitives (and introduced Primitive3dXmlDump for that). The key here is the ScenePrimitive2D, which is the 2D "surface" on which the 3D scene is rendered to.

With this you should be able to write tests for fontwork objects and also other 3D objects. As an example I've added testFontWorks (svx/qa/unit/svdraw.cxx). Tell me if there is something missing.

  [1]: https://gerrit.libreoffice.org/c/core/+/124804

Best regard,
Tomaž





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux