summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-11 13:10:13 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-11 13:20:18 +0300
commitc03986e084e8806f66f7490f2aeeb33db5748e4b (patch)
tree09dcf78337c571518396021bf1acee1cf07e6c09 /drawinglayer
parentb78caf96451de40f7aa54e5b555fa0195e3d0882 (diff)
"Fix" for some SmartArt rendering artefacts on iOS
Exactly why this change works (to the extent that it does) is unclear to me. Whether it could possibly be used across all platforms and not for iOS is also unclear. Change-Id: I6dcf5982d51e5715b657dbf263a88776bbf55f4d
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index e94f5818d077..d1045cc821e4 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -332,9 +332,26 @@ namespace drawinglayer
}
else if(0.0 != fTrans)
{
+#ifndef IOS
+ // For some reason using this "normal" code path on
+ // iOS with tiled rendering causes horrible artefacts:
+ // The mask ends up being drawn too, ending up looking
+ // as translucent milky rectangles covering the
+ // SmartArt (which is what this typically (?) ends up
+ // being used for) ... Why this doesn't cause any
+ // artefacts on OS X, which uses largely the very same
+ // code in vcl/quartz, I don't know.
sal_uInt8 nMaskValue((sal_uInt8)basegfx::fround(fTrans * 255.0));
const AlphaMask aAlphaMask(aSizePixel, &nMaskValue);
mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aAlphaMask));
+#else
+ // Not sure at all why this works, but it does. The
+ // result is not beautiful (jaggies), but better than
+ // blocking out rectangles of the image.
+ Bitmap aMask(aContent);
+ aMask.Convert(BMP_CONVERSION_8BIT_GREYS);
+ mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aMask));
+#endif
}
else
{