[ 
https://issues.apache.org/jira/browse/PDFBOX-5134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17303733#comment-17303733
 ] 

Oliver Schmidtmer commented on PDFBOX-5134:
-------------------------------------------

That is correct, the slow painting is Java itself. However, the clipping area 
is null and the paint applied to the whole image while those shades are 
PDTriangleBasedShadingTypes which only cover a very small area.

For example with the device bounds [x=0,y=0,width=4031,height=2024] a bounding 
rectangle, calculated in GouraudShadingContext.setTriangleList, around the 
triangles for shading COSName\{Sh0} is only 
[x=2916.300048828125,y=897.4940185546875,w=16.97998046875,h=17.0400390625]
 Applying a Paint to such a small area should be much faster. I probably need 
more time to look into how to calculate that beforehand and setting the 
clipping area.

 

> Very slow rendering on PageDrawer.shadingFill
> ---------------------------------------------
>
>                 Key: PDFBOX-5134
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5134
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Oliver Schmidtmer
>            Priority: Major
>              Labels: shading
>         Attachments: Plan zum Testen.pdf, image-2021-03-17-20-16-49-221.png
>
>
> The PDF contains many effectively very small shadings, the light cones. As 
> the gradient painting for each light cone is applied on the whole image, 
> rendering is very slow: 29 of 33 seconds are spent in shadingFill.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to