diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-05 12:58:18 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:15 +0100 |
commit | 26de28fb919169b652fb33f63a2b593dd955a34f (patch) | |
tree | 9f8c3bb97d51d1bc1b88727ea4d56d5a5fb610a9 | |
parent | 402c8d916cf4687345a41be5fbb01c564768186a (diff) |
handle properly Skia color endianess
Change-Id: I59af62fa92903823eb7105d82157017e485ba0df
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 18bd87efdc88..d85ba18ffa76 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -831,27 +831,29 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl // TODO Cache the bitmap SkBitmap aBitmap; aBitmap.allocN32Pixels(4, 4); + const SkPMColor white = SkPreMultiplyARGB(0xFF, 0xFF, 0xFF, 0xFF); + const SkPMColor black = SkPreMultiplyARGB(0xFF, 0x00, 0x00, 0x00); SkPMColor* scanline; scanline = aBitmap.getAddr32(0, 0); - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFF000000; - *scanline++ = 0xFF000000; + *scanline++ = white; + *scanline++ = white; + *scanline++ = black; + *scanline++ = black; scanline = aBitmap.getAddr32(0, 1); - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFF000000; - *scanline++ = 0xFF000000; + *scanline++ = white; + *scanline++ = white; + *scanline++ = black; + *scanline++ = black; scanline = aBitmap.getAddr32(0, 2); - *scanline++ = 0xFF000000; - *scanline++ = 0xFF000000; - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFFFFFFFF; + *scanline++ = black; + *scanline++ = black; + *scanline++ = white; + *scanline++ = white; scanline = aBitmap.getAddr32(0, 3); - *scanline++ = 0xFF000000; - *scanline++ = 0xFF000000; - *scanline++ = 0xFFFFFFFF; - *scanline++ = 0xFFFFFFFF; + *scanline++ = black; + *scanline++ = black; + *scanline++ = white; + *scanline++ = white; // The bitmap is repeated in both directions the checker pattern is as big // as the polygon (usually rectangle) aPaint.setShader(aBitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat)); |