summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-08-24 07:56:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-08-24 07:49:02 +0200
commit1f5ac5b08fd8c1ddadc5f38595a487db2895957e (patch)
tree1437e7b99b19dac57c96fb3720872d2d241c4f6a /vcl
parent2c7bf3543ab798d1c117d9f3258467e4aef9a8db (diff)
Don't apply transparency twice when drawing to mpAlphaVDev
We pass fTransparency to mpAlphaVDev->DrawTransparent; using adjusted fill/line color is wrong. The correct COL_BLACK/COL_TRANSPARENT were already set in mpAlphaVDev when SetFillColor/SetLineColor were called to the virtual device. Wrong implementation from commit 9c621ee8ea41a1c53bfeca49827290826785973e. Change-Id: Ic858ede1ba793ac00f831a3960f748ad20ccb70a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101262 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/transparent.cxx14
1 files changed, 2 insertions, 12 deletions
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index f9da8c9975da..839550c0fe1c 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -248,6 +248,8 @@ void OutputDevice::DrawTransparent(
// create ObjectToDevice transformation
const basegfx::B2DHomMatrix aFullTransform(ImplGetDeviceTransformation() * rObjectTransform);
+ // TODO: this must not drop transparency for mpAlphaVDev case, but instead use premultiplied
+ // aplha... but that requires using premultiplied alpha also for already drawn data
const double fAdjustedTransparency = mpAlphaVDev ? 0 : fTransparency;
bool bDrawnOk(true);
@@ -294,20 +296,8 @@ void OutputDevice::DrawTransparent(
}
if (mpAlphaVDev)
- {
- const Color aFillCol(mpAlphaVDev->GetFillColor());
- const Color aLineColor(mpAlphaVDev->GetLineColor());
- const auto nGreyScale = static_cast<sal_uInt8>(std::round(255 * fTransparency));
- const Color aNewColor(nGreyScale, nGreyScale, nGreyScale);
- mpAlphaVDev->SetFillColor(aNewColor);
- mpAlphaVDev->SetLineColor(aNewColor);
-
mpAlphaVDev->DrawTransparent(rObjectTransform, rB2DPolyPoly, fTransparency);
- mpAlphaVDev->SetFillColor(aFillCol);
- mpAlphaVDev->SetLineColor(aLineColor);
- }
-
return;
}
}