Apache OpenOffice (AOO) Bugzilla – Issue 100888
Provide optimized VCL copy from VDEV to VDEV with mask (also VDEV)
Last modified: 2017-05-20 11:35:11 UTC
AW: For primitives, masking is done opening a VDEV (A) for the target region and painting the child primitives to it. A 2nd VDEV (B) for the mask is created and the mask primitive(s) are painted to it. From both Bitmaps are fetched and merged to a BitmapEx. That bitmap is painted to the real destination. All this happens without MapMode in discrete coordinates (pixels). For complex transparences, the same happens with exchanging (B) with a 8bit alpha mask. Both operations would profit heavily by offering something like void DrawOutDevMasked( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPt, const Size& rSrcSize, const OutputDevice& rOutDev , const OutputDevice& rMaskOutDev); where rMaskOutDev has to be 1bit or 8bit depth and is defined as transparence mask.
AW: Setting to enhancement, of course.
accepted, but a 3.2 target is too optimistic
advancing target
Experimenting with the enhancement on UNX/WIN/OSX shows that the benefit is not worth it for the urgent target: - on UNX the cost is still very much dominated by the polygon drawing => Amdahls law - on WIN/OSX there is no API that allows the blending of e.g. off-screen layers on the graphics card in the way needed for the requested functionality (i.e. the mask is first drawn on a grayscale device, then reinterpreted as alpha mask to be merged with a source layer onto a target layer). Having the grayscale image as a transparency mask as opposed to the much more common alpha mask doesn't help either. The canonical fallback is to get the bitmaps of both input layers, merge them to an alpha-image and draw them again which exactly what is already done by the getBitmap+drawBitmapEx methods, so there wouldn't be any significant speedup. I'll attach the current experimental patch as baseline for further work. At least the requested method could be added to the output device so that middle layers could use this interface instead of implementing the canonical fallback by hand.
Created attachment 70688 [details] experimental patch v1
Reset assigne to the default "issues@openoffice.apache.org".