bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.cxx | 30 +++++++++++++- bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.hxx | 6 ++ bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx | 10 ++++ bridges/source/cpp_uno/gcc3_linux_loongarch64/uno2cpp.cxx | 1 include/vcl/vclenum.hxx | 1 vcl/headless/CairoCommon.cxx | 1 vcl/qt5/QtGraphics_GDI.cxx | 1 vcl/quartz/AquaGraphicsBackend.cxx | 1 vcl/skia/gdiimpl.cxx | 1 vcl/source/outdev/line.cxx | 8 --- vcl/source/outdev/polygon.cxx | 12 +---- vcl/source/outdev/polyline.cxx | 4 - vcl/source/outdev/transparent.cxx | 5 -- vcl/win/gdi/gdiimpl.cxx | 4 - 14 files changed, 52 insertions(+), 33 deletions(-)
New commits: commit ff55268583324c7c62c6c0988384a9f0f2d18d8b Author: wujiahuan <wujiah...@loongson.cn> AuthorDate: Mon Jul 24 14:55:50 2023 +0800 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Jul 31 09:52:43 2023 +0200 fix CustomTarget_uno_test check failed with enable java on loongarch64 Change-Id: Iadb1f16eb10761cdef392110986bddda44ddee3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154833 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.cxx index 686cbb596317..f9eb09517358 100644 --- a/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.cxx @@ -56,6 +56,8 @@ int loongarch64::flatten_struct(typelib_TypeDescription* pTypeDescr, Registers& regs.priorInt = true; break; case typelib_TypeClass_FLOAT: + regs.complex_float = true; + [[fallthrough]]; case typelib_TypeClass_DOUBLE: regs.nr_fp++; if (!regs.priorInt && !regs.priorFp) @@ -88,22 +90,34 @@ loongarch64::ReturnKind loongarch64::getReturnKind(typelib_TypeDescriptionRefere return ReturnKind::RegistersFp; case typelib_TypeClass_STRUCT: { - Registers regs = { 0, 0, false, false }; + Registers regs = { false, false, false, 0, 0 }; typelib_TypeDescription* pTypeDescr = nullptr; TYPELIB_DANGER_GET(&pTypeDescr, pTypeRef); int sum = flatten_struct(pTypeDescr, regs); TYPELIB_DANGER_RELEASE(pTypeDescr); if ((sum == 1 || sum == 2) && sum == regs.nr_fp) + { + if (regs.complex_float && pTypeRef->pType->nSize == 8) + return ReturnKind::RegistersTwoFloat; return ReturnKind::RegistersFp; + } if (sum == 2 && regs.nr_fp == regs.nr_int) { if (regs.priorInt) + { + if (regs.complex_float && pTypeRef->pType->nSize == 8) + return ReturnKind::RegistersIntFloat; return ReturnKind::RegistersIntFp; + } if (regs.priorFp) + { + if (regs.complex_float && pTypeRef->pType->nSize == 8) + return ReturnKind::RegistersFloatInt; return ReturnKind::RegistersFpInt; + } } - return ReturnKind::RegistersInt; } + [[fallthrough]]; default: return ReturnKind::RegistersInt; } @@ -119,14 +133,26 @@ void loongarch64::fillReturn(typelib_TypeDescriptionReference* pTypeRef, sal_Int reinterpret_cast<double*>(pRegisterReturn)[0] = fret[0]; reinterpret_cast<double*>(pRegisterReturn)[1] = fret[1]; break; + case ReturnKind::RegistersTwoFloat: + memcpy(reinterpret_cast<char*>(pRegisterReturn), &(fret[0]), 4); + memcpy(reinterpret_cast<char*>(pRegisterReturn) + 4, &(fret[1]), 4); + break; case ReturnKind::RegistersFpInt: reinterpret_cast<double*>(pRegisterReturn)[0] = fret[0]; reinterpret_cast<sal_Int64*>(pRegisterReturn)[1] = gret[0]; break; + case ReturnKind::RegistersFloatInt: + memcpy(reinterpret_cast<char*>(pRegisterReturn), fret, 4); + memcpy(reinterpret_cast<char*>(pRegisterReturn) + 4, gret, 4); + break; case ReturnKind::RegistersIntFp: reinterpret_cast<sal_Int64*>(pRegisterReturn)[0] = gret[0]; reinterpret_cast<double*>(pRegisterReturn)[1] = fret[0]; break; + case ReturnKind::RegistersIntFloat: + memcpy(reinterpret_cast<char*>(pRegisterReturn), gret, 4); + memcpy(reinterpret_cast<char*>(pRegisterReturn) + 4, fret, 4); + break; default: reinterpret_cast<sal_Int64*>(pRegisterReturn)[0] = gret[0]; reinterpret_cast<sal_Int64*>(pRegisterReturn)[1] = gret[1]; diff --git a/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.hxx index 90aa544f128b..1fe9e9b58866 100644 --- a/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_loongarch64/abi.hxx @@ -30,11 +30,15 @@ enum class ReturnKind { RegistersInt, RegistersFp, + RegistersTwoFloat, RegistersFpInt, - RegistersIntFp + RegistersFloatInt, + RegistersIntFp, + RegistersIntFloat }; typedef struct Registers { + bool complex_float; bool priorInt; bool priorFp; int nr_fp; diff --git a/bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx index aa8f4be3cf72..1a0c42b0da67 100644 --- a/bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx @@ -263,10 +263,19 @@ static int cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy* pThis, } switch (returnKind) { + case loongarch64::ReturnKind::RegistersIntFloat: + memcpy(pRegisterReturn + 1, static_cast<char*>(pUnoReturn) + 4, 4); + [[fallthrough]]; case loongarch64::ReturnKind::RegistersIntFp: return 0; + case loongarch64::ReturnKind::RegistersFloatInt: + memcpy(pRegisterReturn + 1, static_cast<char*>(pUnoReturn) + 4, 4); + [[fallthrough]]; case loongarch64::ReturnKind::RegistersFpInt: return 1; + case loongarch64::ReturnKind::RegistersTwoFloat: + memcpy(pRegisterReturn + 1, static_cast<char*>(pUnoReturn) + 4, 4); + [[fallthrough]]; default: return -1; } @@ -386,6 +395,7 @@ int cpp_vtable_call(sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, void** gp TYPELIB_DANGER_RELEASE(pTD); } } // else perform queryInterface() + [[fallthrough]]; default: typelib_InterfaceMethodTypeDescription* pMethodTD = reinterpret_cast<typelib_InterfaceMethodTypeDescription*>( diff --git a/bridges/source/cpp_uno/gcc3_linux_loongarch64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_loongarch64/uno2cpp.cxx index 7242a43bd76c..c4e7815e0a0a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_loongarch64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_loongarch64/uno2cpp.cxx @@ -450,6 +450,7 @@ void unoInterfaceProxyDispatch(uno_Interface* pUnoI, const typelib_TypeDescripti TYPELIB_DANGER_RELEASE(pTD); } } // else perform queryInterface() + [[fallthrough]]; default: // dependent dispatch cpp_call( commit acbdda150534927852cd475f94c3fcb1f9db53da Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jul 30 21:46:07 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Jul 31 09:52:37 2023 +0200 supportsOperation OutDevSupportType::B2DDraw is always true now since: commit 4998de76ed1da4039e30718941d50d6f1dfe4f82 Date: Sun Jul 30 07:40:48 2023 +0000 tdf#156230: Drop freshly unused GenPspGfxBackend Change-Id: I1adc30a60aec0c5aab9289e9c0505d1dbad10631 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155074 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 9f9abd75d1df..4b754d1b66b1 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -162,7 +162,6 @@ typedef sal_uInt32 sal_UCS4; // TODO: this should be moved to rtl enum class OutDevSupportType { TransparentRect, - B2DDraw, TransparentText // if alpha in TextColor can be honored }; diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index d378d1477bd4..417fd633f87e 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -1979,7 +1979,6 @@ bool CairoCommon::supportsOperation(OutDevSupportType eType) { case OutDevSupportType::TransparentRect: case OutDevSupportType::TransparentText: - case OutDevSupportType::B2DDraw: return true; } return false; diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx index 70c598c8bcd9..5ce68cfa9d0f 100644 --- a/vcl/qt5/QtGraphics_GDI.cxx +++ b/vcl/qt5/QtGraphics_GDI.cxx @@ -683,7 +683,6 @@ bool QtGraphicsBackend::supportsOperation(OutDevSupportType eType) const { switch (eType) { - case OutDevSupportType::B2DDraw: case OutDevSupportType::TransparentRect: return true; default: diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index 75753b9f9978..cf1851662c2e 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -1334,7 +1334,6 @@ bool AquaGraphicsBackend::supportsOperation(OutDevSupportType eType) const switch (eType) { case OutDevSupportType::TransparentRect: - case OutDevSupportType::B2DDraw: return true; default: break; diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index e6c373c2f86b..503892287ed4 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -2178,7 +2178,6 @@ bool SkiaSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const { switch (eType) { - case OutDevSupportType::B2DDraw: case OutDevSupportType::TransparentRect: return true; default: diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index 7a5611d71d6b..041c6c16c345 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -184,9 +184,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) bool bDrawn = false; // #i101598# support AA and snap for lines, too - if( mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) - && RasterOp::OverPaint == GetRasterOp() - && IsLineColor()) + if (RasterOp::OverPaint == GetRasterOp() && IsLineColor()) { // at least transform with double precision to device coordinates; this will // avoid pixel snap of single, appended lines @@ -225,9 +223,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const LineInfo& rInfo ) { static const bool bFuzzing = utl::ConfigManager::IsFuzzing(); - const bool bTryB2d(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) - && RasterOp::OverPaint == GetRasterOp() - && IsLineColor()); + const bool bTryB2d(RasterOp::OverPaint == GetRasterOp() && IsLineColor()); basegfx::B2DPolyPolygon aFillPolyPolygon; const bool bDashUsed(LineStyle::Dash == rInfo.GetStyle()); const bool bLineWidthUsed(rInfo.GetWidth() > 1); diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index a261f0c23f60..fb876e425975 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -61,9 +61,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly ) InitFillColor(); // use b2dpolygon drawing if possible - if(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && - RasterOp::OverPaint == GetRasterOp() && - (IsLineColor() || IsFillColor())) + if (RasterOp::OverPaint == GetRasterOp() && (IsLineColor() || IsFillColor())) { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPoly.getB2DPolyPolygon()); @@ -181,9 +179,7 @@ void OutputDevice::DrawPolygon( const tools::Polygon& rPoly ) InitFillColor(); // use b2dpolygon drawing if possible - if(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && - RasterOp::OverPaint == GetRasterOp() && - (IsLineColor() || IsFillColor())) + if (RasterOp::OverPaint == GetRasterOp() && (IsLineColor() || IsFillColor())) { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolygon aB2DPolygon(rPoly.getB2DPolygon()); @@ -291,9 +287,7 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP bool bSuccess(false); - if(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && - RasterOp::OverPaint == GetRasterOp() && - (IsLineColor() || IsFillColor())) + if (RasterOp::OverPaint == GetRasterOp() && (IsLineColor() || IsFillColor())) { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly); diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index 14bd3de2bc75..75e8252f4ae2 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -366,9 +366,7 @@ bool OutputDevice::DrawPolyLineDirectInternal( if( mbInitLineColor ) InitLineColor(); - const bool bTryB2d(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && - RasterOp::OverPaint == GetRasterOp() && - IsLineColor()); + const bool bTryB2d(RasterOp::OverPaint == GetRasterOp() && IsLineColor()); if(bTryB2d) { diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 29404aa84f6f..b114d735e7bf 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -114,8 +114,7 @@ void OutputDevice::DrawTransparent( if( mbInitFillColor ) InitFillColor(); - if(mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && - (RasterOp::OverPaint == GetRasterOp()) ) + if (RasterOp::OverPaint == GetRasterOp()) { // b2dpolygon support not implemented yet on non-UNX platforms basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly); @@ -199,7 +198,7 @@ bool OutputDevice::DrawTransparentNatively ( const tools::PolyPolygon& rPolyPoly bool bDrawn = false; - if (mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) + if (true #if defined UNX && ! defined MACOSX && ! defined IOS && GetBitCount() > 8 #endif diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 708f9e7ac51a..785c2f09168b 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -2717,7 +2717,6 @@ bool WinSalGraphicsImpl::implDrawGradient(basegfx::B2DPolyPolygon const & /*rPol bool WinSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const { - static bool bAllowForTest(true); bool bRet = false; switch (eType) @@ -2725,9 +2724,6 @@ bool WinSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const case OutDevSupportType::TransparentRect: bRet = mrParent.mbVirDev || mrParent.mbWindow; break; - case OutDevSupportType::B2DDraw: - bRet = bAllowForTest; - break; default: break; }