summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-19 11:15:00 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-22 13:49:14 +0100
commit6b2d8e2d88a67d446827ed0ab968f0a06e297d18 (patch)
tree11c4311b66028309b1ecb9892cbbf89972e131cb
parent53ce0e3af4dcb1c70380016b3824da71548cdc60 (diff)
handle filling and stroking at the same time if possible
All tests still pass, so the end result should be the same, but this way it's done in one call. Change-Id: If5da34837a45ad600ae30568e4ba7651ac5838bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125644 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--vcl/inc/skia/gdiimpl.hxx5
-rw-r--r--vcl/skia/gdiimpl.cxx4
2 files changed, 6 insertions, 3 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index aeaef186ca44..cc4cda4b2ebd 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -327,7 +327,10 @@ protected:
paint.setColor(transparency == 0
? SkiaHelper::toSkColor(mFillColor)
: SkiaHelper::toSkColorWithTransparency(mFillColor, transparency));
- paint.setStyle(SkPaint::kFill_Style);
+ if (mLineColor == mFillColor)
+ paint.setStyle(SkPaint::kStrokeAndFill_Style);
+ else
+ paint.setStyle(SkPaint::kFill_Style);
return paint;
}
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 6f326d6c5aa8..3d7697c4dcfa 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -853,7 +853,7 @@ void SkiaSalGraphicsImpl::privateDrawAlphaRect(tools::Long nX, tools::Long nY, t
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawIRect(SkIRect::MakeXYWH(nX, nY, nWidth, nHeight), paint);
}
- if (mLineColor != SALCOLOR_NONE)
+ if (mLineColor != SALCOLOR_NONE && mLineColor != mFillColor) // otherwise handled by fill
{
SkPaint paint = makeLinePaint(fTransparency);
paint.setAntiAlias(!blockAA && mParent.getAntiAlias());
@@ -992,7 +992,7 @@ void SkiaSalGraphicsImpl::performDrawPolyPolygon(const basegfx::B2DPolyPolygon&
aPaint.setStyle(SkPaint::kStroke_Style);
getDrawCanvas()->drawPath(polygonPath, aPaint);
}
- if (mLineColor != SALCOLOR_NONE)
+ if (mLineColor != SALCOLOR_NONE && mLineColor != mFillColor) // otherwise handled by fill
{
SkPaint aPaint = makeLinePaint(fTransparency);
aPaint.setAntiAlias(useAA);