summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-11-04 15:51:09 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-26 13:24:55 +0100
commit7cd44e5dbf5c6e702fe39cc662275d494e114097 (patch)
tree96ebc527f4723ae7d76d2d189535c2afb7a6e90b
parent71fade2cef148cbc75f0c63698258a67b34af0a0 (diff)
fix Skia text color on X11
Change-Id: I061acb80294c3bd6b45bd60dbb32c9a906619ed0
-rw-r--r--vcl/skia/x11/cairotextrender.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/skia/x11/cairotextrender.cxx b/vcl/skia/x11/cairotextrender.cxx
index 82577d026ce9..73b7fc1052db 100644
--- a/vcl/skia/x11/cairotextrender.cxx
+++ b/vcl/skia/x11/cairotextrender.cxx
@@ -11,6 +11,7 @@
#include <salbmp.hxx>
#include <skia/gdiimpl.hxx>
+#include <osl/endian.h>
#include <cairo.h>
@@ -71,8 +72,14 @@ void SkiaX11CairoTextRender::releaseCairoContext(cairo_t* cr)
SalTwoRect aRect(0, 0, nWidth, nHeight, aClipRect.Left(), aClipRect.Top(), nWidth, nHeight);
+ SkImageInfo info;
+#ifdef OSL_LITENDIAN
+ info = SkImageInfo::Make(nWidth, nHeight, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
+#else
+ info = SkImageInfo::Make(nWidth, nHeight, kARGB_8888_SkColorType, kPremul_SkAlphaType);
+#endif
SkBitmap bitmap;
- if (!bitmap.installPixels(SkImageInfo::MakeN32Premul(nWidth, nHeight), pSrc, nWidth * 4))
+ if (!bitmap.installPixels(info, pSrc, nWidth * 4))
abort();
pImpl->drawBitmap(aRect, bitmap);