diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-07-03 12:29:47 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-07-10 16:21:55 +0200 |
commit | df9f0e3cc57fb69ee38918b25ed91d97d1972685 (patch) | |
tree | 2be0bae808e26a0b4a32798896c528ad1efda78b /canvas/source | |
parent | e6f53ed4157ddf116d4d0021b8bc962c112a1d0b (diff) |
prefer 8bit bitmap masks to 1bpp masks
It's much simpler and more performant to work with 8bpp bytes
rather than fiddle with 1bpp bits, and the memory savings don't
really matter nowadays. E.g. the soft edges feature performs
much worse when operating on 1bpp bitmaps (tdf#134237).
I've looked and it seems nothing in LO code actually requires
bitmap masks to really be 1bpp. As a next step we could perhaps
also leave antiquity and embrace the past by dropping 1bpp masks
entirely and using just alpha masks.
The change also moves the workaround for #i75531, it was breaking
CppunitTest_vcl_svm_test and X11-related hacks belong to the X11
code (especially with the X11 backend becoming more and more niche).
Change-Id: I7848f06c8b83bbad2ea35f17f2b65855f8d1f456
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97839
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/directx/dx_vcltools.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx index d88c586c3245..287ed7beda54 100644 --- a/canvas/source/directx/dx_vcltools.cxx +++ b/canvas/source/directx/dx_vcltools.cxx @@ -168,9 +168,9 @@ namespace dxcanvas "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unable to acquire read access to bitmap" ); - if( rBmpEx.IsAlpha() ) + if( rBmpEx.IsAlpha() || rBmpEx.GetMask().GetBitCount() == 8 ) { - Bitmap aAlpha( rBmpEx.GetAlpha().GetBitmap() ); + Bitmap aAlpha( rBmpEx.IsAlpha() ? rBmpEx.GetAlpha().GetBitmap() : rBmpEx.GetMask()); Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha ); |