Kaydet (Commit) a4664759 authored tarafından Noel Grandin's avatar Noel Grandin

use RawBitmap in W_META_BITBLT

part of making BitmapWriteAccess an internal detail of vcl/

Change-Id: I23393872fca5a924ceb7ca70edd8e6f70a3cfc13
Reviewed-on: https://gerrit.libreoffice.org/49965Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6fbb6d80
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <tools/fract.hxx> #include <tools/fract.hxx>
#include <o3tl/make_unique.hxx> #include <o3tl/make_unique.hxx>
#include <vcl/bitmapaccess.hxx> #include <vcl/bitmapaccess.hxx>
#include <vcl/BitmapTools.hxx>
#include <osl/thread.h> #include <osl/thread.h>
// MS Windows defines // MS Windows defines
...@@ -714,13 +715,9 @@ namespace emfio ...@@ -714,13 +715,9 @@ namespace emfio
} }
if (bOk) if (bOk)
{ {
Bitmap aBmp( Size( nWidth, nHeight ), nBitCount ); vcl::bitmap::RawBitmap aBmp( Size( nWidth, nHeight ) );
Bitmap::ScopedWriteAccess pAcc(aBmp);
if ( pAcc )
{
for (sal_uInt16 y = 0; y < nHeight && mpInputStream->good(); ++y) for (sal_uInt16 y = 0; y < nHeight && mpInputStream->good(); ++y)
{ {
Scanline pScanline = pAcc->GetScanline( y );
sal_uInt16 x = 0; sal_uInt16 x = 0;
for (sal_uInt16 scan = 0; scan < nBytesPerScan; scan++ ) for (sal_uInt16 scan = 0; scan < nBytesPerScan; scan++ )
{ {
...@@ -730,23 +727,22 @@ namespace emfio ...@@ -730,23 +727,22 @@ namespace emfio
{ {
if ( x < nWidth ) if ( x < nWidth )
{ {
pAcc->SetPixelOnData( pScanline, x, BitmapColor((nEightPixels>>i)&1) ); aBmp.SetPixel( y, x, Color(((nEightPixels>>i)&1) ? COL_BLACK : COL_WHITE) );
} }
x++; x++;
} }
} }
} }
pAcc.reset(); BitmapEx aBitmap = vcl::bitmap::CreateFromData(std::move(aBmp));
if ( nSye && nSxe && if ( nSye && nSxe &&
( nSx + nSxe <= aBmp.GetSizePixel().Width() ) && ( nSx + nSxe <= nWidth ) &&
( nSy + nSye <= aBmp.GetSizePixel().Height() ) ) ( nSy + nSye <= nHeight ) )
{ {
tools::Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) ); tools::Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) );
aBmp.Crop( aCropRect ); aBitmap.Crop( aCropRect );
} }
tools::Rectangle aDestRect( aPoint, Size( nSxe, nSye ) ); tools::Rectangle aDestRect( aPoint, Size( nSxe, nSye ) );
maBmpSaveList.emplace_back(new BSaveStruct(aBmp, aDestRect, nWinROP)); maBmpSaveList.emplace_back(new BSaveStruct(aBitmap, aDestRect, nWinROP));
}
} }
} }
break; break;
......
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