summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-03-23 16:13:26 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-03-23 17:14:04 +0000
commit462ebbd10bd537f42104fe991a0aeebcd563f178 (patch)
tree77ad4e2aa83424efa458f99a6e5deee5d321dfa0 /scripting
parent7ecc9925f3b0d1cea4ee7201473dd6fbbb95c271 (diff)
MCGR: Speedup Gradient Paint for VCLPixelProcessor
To do this, I re-organized FillGradientPrimitive2D and how it creates it's decompose. This provides the needed tooling to also do a more direct rendering in primitive processors if needed. The decompose no longer collects the matrices & colors as a 1st step in a helper data struecture (so I removed B2DHomMatrixAndBColor). It now uses a lambda function callback that hands over the matrix & color for each created step, so you can process it directly, in this case to create the needed primitives. NOTE: The decompositions are both tested. There was createNonOverlappingFill, but also createOverlappingFill that I am not sure is still used - and if in re-creating an old, strange XOR-using gradient paint mechanism in old metafiles (encapsulated with gradient info anyways), but I converted that and made sure it works. To do so I forced it to be used in paint. This is not really usable in paint since we need to paint using AA (else we would get staircase effects, esp. in new 'hard' color changes in multi-color gradients) and - as should be known - same edges painted in AA do *not* add up to full opacity, but leave behind awful 'jaggies' (e.g. opacity 0.5 and 0.5 create 0.75 and *not* 1.0). Still important to have the working geometry creation for this case. This already makes the decompose faster, but the main purpose is to use it as tooling for painting in own primitive renderers. Thus processFillGradientPrimitive2D now uses that instead of using the decomposition by default. This avoids one level of primitive creation, use that new FillGradientPrimitive2D tooling to directly create needed geoemtry & color for getting better performance (to partially compensate for potentially more expensive multi color gradients). It then paints directly using OutputDevice calls. NOTE: This can also be used in SDPRs as a 1st step to just directly and rapidly render filled single- color polygons, but of course there an implementation using the back-transformations (which are also adapted for MCGRs aleady and work) will be superior. Change-Id: I5079f76d6d8fe86007a098614c276447f2bfebce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149456 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'scripting')
0 files changed, 0 insertions, 0 deletions