Kaydet (Commit) 9aee1dd5 authored tarafından Miklos Vajna's avatar Miklos Vajna

vcl: allow using pre-calculated layout in OutputDevice::DrawTextArray()

I plan to use this in SwFntObj::DrawText().

Change-Id: Ic5e167d90a7e72452d8efa9fad06b8067675a225
Reviewed-on: https://gerrit.libreoffice.org/59108
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst f24b0ec1
......@@ -1149,7 +1149,9 @@ public:
const long* pDXAry,
sal_Int32 nIndex = 0,
sal_Int32 nLen = -1,
SalLayoutFlags flags = SalLayoutFlags::NONE);
SalLayoutFlags flags = SalLayoutFlags::NONE,
vcl::TextLayoutCache const* = nullptr,
SalLayout* pLayoutCache = nullptr);
long GetTextArray( const OUString& rStr, long* pDXAry,
sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
vcl::TextLayoutCache const* = nullptr,
......
......@@ -944,7 +944,9 @@ float OutputDevice::approximate_digit_width() const
void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
const long* pDXAry,
sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags )
sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags,
vcl::TextLayoutCache const*const pLayoutCache,
SalLayout* pSalLayoutCache )
{
assert(!is_double_buffered_window());
......@@ -964,7 +966,13 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
if( mbOutputClipped )
return;
std::unique_ptr<SalLayout> pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags);
SalLayout* pSalLayout = pSalLayoutCache;
std::unique_ptr<SalLayout> pLayout;
if (!pSalLayout)
{
pLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags, pLayoutCache);
pSalLayout = pLayout.get();
}
if( pSalLayout )
{
ImplDrawText( *pSalLayout );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment