Using OutputDevice::DrawTransparent fails

Matteo Campanelli matteo.campanelli at
Tue May 27 13:13:24 PDT 2014

Some further experiments:
- changing the text color to non-black did not change the grey-ish
background for the arrow's text;
- using SetTextFillColor immediately before does not change anything;
- debugging inside DrawTransparent I've seen that there is a "return false"
that is triggered three frames deeper: DrawTransparent ->
OutputDevice::DrawTransparentNatively -> SalGraphics::DrawPolyPolygon ->
In the last function this if-statement is triggered and the polypolygon is
never drawn I suspect:
[in core/vcl/unx/generic/gdi/salgdi.cxx:1023 ]
// cannot handle pencolor!=brushcolor yet
    if( (nPenColor_ != SALCOLOR_NONE)
    &&  (nPenColor_ != nBrushColor_) )
        return false;

*Errata on my last commit message*: It is mpGraphics->DrawRect to be
commented, not DrawTextRect.


On Tue, May 27, 2014 at 1:57 PM, Matteo Campanelli <
matteo.campanelli at> wrote:

> Hi all,
> i was trying to set a transparent background in text areas in Draw.
> I replaced the call to mpGraphics->DrawRect in OutputDevice::ImplDrawText
> with a call to DrawTransparent on the same area. However the result has
> issues such as [see attached picture]:
> - not giving the expected color (the arrow text in the picture should be
> the same color as the text area's),
> - leaving old rendering leftovers around when text is moved (or the
> related arrow in this case).
> I tried to debug how other transparent areas are drawn but that didn't
> give much insight.
> Does anyone any experience with this or any guess on what may be going
> wrong?
> Thanks,
> Matteo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list