summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-18 12:20:15 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-18 16:44:03 +0100
commit5a76ae27a90fcb7e170a1cdd822a4bfd260e03a3 (patch)
tree96d6bf31bb7291ee99b17ad746a84703cb6beaa9
parent07a9d2f60dabac5b8f9d10acb73a8eade1593aae (diff)
fix background color of some native controls with Skia/Mac (tdf#145748)
Some of the control drawing calls use CGContextFillRect() to draw background for controls, so since we use a temporary context, set up colors for such drawing. Change-Id: I41cfa29e29fcf86598d49fbbed0b159c48c63d6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125468 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--vcl/skia/osx/gdiimpl.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx
index 0f451f8916df..58e03e16f3be 100644
--- a/vcl/skia/osx/gdiimpl.cxx
+++ b/vcl/skia/osx/gdiimpl.cxx
@@ -201,6 +201,15 @@ bool AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
SAL_WARN("vcl.skia", "drawNativeControl(): Failed to allocate bitmap context");
return false;
}
+ // Setup context state for drawing (performDrawNativeControl() e.g. fills background in some cases).
+ CGContextSetFillColorSpace(context, GetSalData()->mxRGBSpace);
+ CGContextSetStrokeColorSpace(context, GetSalData()->mxRGBSpace);
+ RGBAColor lineColor = RGBAColor(mLineColor);
+ CGContextSetRGBStrokeColor(context, lineColor.GetRed(), lineColor.GetGreen(),
+ lineColor.GetBlue(), lineColor.GetAlpha());
+ RGBAColor fillColor = RGBAColor(mFillColor);
+ CGContextSetRGBFillColor(context, fillColor.GetRed(), fillColor.GetGreen(), fillColor.GetBlue(),
+ fillColor.GetAlpha());
// Adjust for our drawn-to coordinates in the bitmap.
tools::Rectangle movedRegion(Point(0, 0), rControlRegion.GetSize());
// Flip drawing upside down.