summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-01-30 17:27:11 +0000
committerArmin Le Grand <alg@apache.org>2014-01-30 17:27:11 +0000
commit342ebf4c79972ba3e1159831fce04cdef80f585b (patch)
treed9db096fd461ec3e22858efb3ce0fa32db241f14 /canvas
parent55aeb4ebc2da692490c1ec5ac69941f51c01970d (diff)
i12355 Allow 1bit masks for all OSes except Linux (see i122485)
Notes
reject: works for me
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvascustomsprite.cxx9
-rwxr-xr-xcanvas/source/vcl/spritehelper.cxx8
2 files changed, 15 insertions, 2 deletions
diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx
index 1287ed7ed4c0..39ae9d6fb6c8 100644
--- a/canvas/source/vcl/canvascustomsprite.cxx
+++ b/canvas/source/vcl/canvascustomsprite.cxx
@@ -81,7 +81,14 @@ namespace vclcanvas
pBackBuffer->setSize( aSize );
// create mask backbuffer, with one bit color depth #122485# use full depth to avoid problem with 1bit depth, get AAed masks
- BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev() ) ); // , true ) ); // #122485#
+ BackBufferSharedPtr pBackBufferMask(
+#if defined LINUX || defined FREEBSD || defined NETBSD
+ // #122485# no 1bit buffers on Linuxes, 1bit Vdev seems to work no longer
+ new BackBuffer( rOutDevProvider->getOutDev() ) );
+#else
+ // 1bit mask buffer for all others
+ new BackBuffer( rOutDevProvider->getOutDev(), true ) );
+#endif
pBackBufferMask->setSize( aSize );
// TODO(F1): Implement alpha vdev (could prolly enable
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 2440ad3bfd75..b7930900ea97 100755
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -159,7 +159,13 @@ namespace vclcanvas
// bitmasks are much faster than alphamasks on some platforms
// so convert to bitmask if useful
-#ifndef QUARTZ
+#if defined LINUX || defined FREEBSD || defined NETBSD || defined QUARTZ
+ // #122485# allow more than 1bit masks for Linux and Mac,
+ // but reduce to mono now
+ aMask.MakeMono(255);
+#else
+ // #122485# assert when mask uses more than 1bit and reduce
+ // to mono
if( aMask.GetBitCount() != 1 )
{
OSL_ENSURE(false,