vcl/source/bitmap/BlendFrameCache.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
New commits: commit 11bc8cc7d89f69a0fdcf97db92fd86299acc0734 Author: Christopher Sherlock <chris.sherloc...@gmail.com> AuthorDate: Thu Dec 5 00:58:52 2024 +1100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jan 15 17:39:56 2025 +0100 vcl: move variables closers to first use Change-Id: Ie1d5ee1270c565a73cee54726c147300f27593e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177805 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/source/bitmap/BlendFrameCache.cxx b/vcl/source/bitmap/BlendFrameCache.cxx index f233591f0abe..fc883710c988 100644 --- a/vcl/source/bitmap/BlendFrameCache.cxx +++ b/vcl/source/bitmap/BlendFrameCache.cxx @@ -34,10 +34,7 @@ BlendFrameCache::BlendFrameCache(Size const& rSize, sal_uInt8 nAlpha, Color cons , m_aLastColorBottomRight(rColorBottomRight) , m_aLastColorBottomLeft(rColorBottomLeft) { - const tools::Long nW(rSize.Width()); - const tools::Long nH(rSize.Height()); - - if (nW <= 1 || nH <= 1) + if (rSize.Width() <= 1 || rSize.Height() <= 1) return; sal_uInt8 aEraseTrans(0xff); @@ -52,8 +49,6 @@ BlendFrameCache::BlendFrameCache(Size const& rSize, sal_uInt8 nAlpha, Color cons if (!pContent || !pAlpha) return; - tools::Long x(0); - tools::Long y(0); Scanline pScanContent = pContent->GetScanline(0); Scanline pScanAlpha = pContent->GetScanline(0); @@ -61,6 +56,9 @@ BlendFrameCache::BlendFrameCache(Size const& rSize, sal_uInt8 nAlpha, Color cons pContent->SetPixelOnData(pScanContent, 0, rColorTopLeft); pAlpha->SetPixelOnData(pScanAlpha, 0, BitmapColor(nAlpha)); + tools::Long x(0); + const tools::Long nW(rSize.Width()); + // y == 0, top line left to right for (x = 1; x < nW - 1; x++) { @@ -79,6 +77,9 @@ BlendFrameCache::BlendFrameCache(Size const& rSize, sal_uInt8 nAlpha, Color cons pAlpha->SetPixelOnData(pScanAlpha, x, BitmapColor(nAlpha)); } + tools::Long y(0); + const tools::Long nH(rSize.Height()); + // x == 0 and nW - 1, left and right line top-down for (y = 1; y < nH - 1; y++) {