Opened 5 years ago

Closed 4 years ago

#10877 closed enhancement (fixed)

ClipToPicture is too slow

Reported by: pulkomandy Owned by: stippi
Priority: normal Milestone: R1
Component: Servers/app_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description (last modified by pulkomandy)

We now have a working implementation of ClipToPicture. It is the only way to perform clipping in the transformed view space (ConstrainClippingRegion does not work with transforms). However, ClipToPicture hit tests work by alpha blending pixels, which is slow.

WebKit makes heavy use of that feature which makes it painful to use. We have to make this work faster.

An idea is to compute the un-transformed bounds of the clipping picture covered area, and use rectangle clipping to exclude anything outside that area from the drawing. When using a big view and a small clipping picture, this could cut down the time a lot. This extra clipping rectangle needs to be computed whenever the AlphaMask is generated, as changes in the view state could lead to different results.

Maybe there are other ways to improve this on the drawing side: avoiding the alpha blending when the clipping picture is only made of fully opaque or fully transparent pixels, for example? This may needs changes to agg rasterizer code.

Change History (1)

comment:1 by pulkomandy, 4 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

Jua solved this. Thanks!

Note: See TracTickets for help on using tickets.