Blame SOURCES/0170-vcl-tiled-rendering-avoid-Pixel-represents-color-val.patch

135360
From 95c0e2be5e09f8e658295ea12f814706664c431f Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Fri, 2 Oct 2015 10:31:35 +0200
135360
Subject: [PATCH 170/398] vcl tiled rendering: avoid 'Pixel represents color
135360
 values!' warnings
135360
135360
Which happens e.g. during rendering tiles:
135360
OutputDevice::BlendBitmapWithAlpha() produces an RGB alpha
135360
(255,255,255), then tries to set a pixel in the 8bit alpha channel using
135360
it, so when BitmapReadAccess::SetPixelFor_8BIT_PAL() tries to get the
135360
color index, we try to get it from a color that is not indexed.
135360
135360
Let's assume that when the color is not indexed, it's always gray, so it
135360
doesn't matter what color we pick for the alpha mask needs.
135360
135360
Change-Id: I325c1d70514fd176fdc9cc39683b444447adf07f
135360
(cherry picked from commit 4caaa09d4da0f7bd5aa0fae3233d66bd977f185e)
135360
---
135360
 vcl/source/gdi/bmpacc2.cxx | 6 +++++-
135360
 1 file changed, 5 insertions(+), 1 deletion(-)
135360
135360
diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx
135360
index d664c4b769fd..286ea8fca26a 100644
135360
--- a/vcl/source/gdi/bmpacc2.cxx
135360
+++ b/vcl/source/gdi/bmpacc2.cxx
135360
@@ -79,7 +79,11 @@ BitmapColor BitmapReadAccess::GetPixelFor_8BIT_PAL(ConstScanline pScanline, long
135360
 
135360
 void BitmapReadAccess::SetPixelFor_8BIT_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&)
135360
 {
135360
-    pScanline[ nX ] = rBitmapColor.GetIndex();
135360
+    if (rBitmapColor.IsIndex())
135360
+        pScanline[ nX ] = rBitmapColor.GetIndex();
135360
+    else
135360
+        // Let's hope that the RGB color values equal, so it doesn't matter what do we pick
135360
+        pScanline[ nX ] = rBitmapColor.GetBlueOrIndex();
135360
 }
135360
 
135360
 BitmapColor BitmapReadAccess::GetPixelFor_8BIT_TC_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask)
135360
-- 
135360
2.12.0
135360