diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-04 15:51:09 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:15 +0100 |
commit | f109a1ac6fdf0c878d53dfea6fceffd93248608f (patch) | |
tree | cd20173e8e4fdb19ffa446300bb2ef27bf694e27 | |
parent | 0676a7ca73824ec7c972171bf6f2ae7c6ed1c5b6 (diff) |
fix Skia text color on X11
Change-Id: I061acb80294c3bd6b45bd60dbb32c9a906619ed0
-rw-r--r-- | vcl/skia/x11/cairotextrender.cxx | 9 |
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); |