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

Bitmap->BitmapEx in BitmapFactory

Change-Id: I7f88333a74f7c523030ab55b896c316b3aa73cce
Reviewed-on: https://gerrit.libreoffice.org/55282Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 874f2d84
...@@ -46,7 +46,7 @@ BitmapFactory::~BitmapFactory() ...@@ -46,7 +46,7 @@ BitmapFactory::~BitmapFactory()
{ {
} }
Bitmap BitmapFactory::CreateBitmap ( BitmapEx BitmapFactory::CreateBitmap (
const SdPage& rPage, const SdPage& rPage,
const Size& rPixelSize, const Size& rPixelSize,
const bool bDoSuperSampling) const bool bDoSuperSampling)
...@@ -60,11 +60,11 @@ Bitmap BitmapFactory::CreateBitmap ( ...@@ -60,11 +60,11 @@ Bitmap BitmapFactory::CreateBitmap (
aSize.setHeight( aSize.Height() * aSuperSamplingFactor ); aSize.setHeight( aSize.Height() * aSuperSamplingFactor );
} }
Bitmap aPreview (maRenderer.RenderPage ( BitmapEx aPreview (maRenderer.RenderPage (
&rPage, &rPage,
aSize, aSize,
true, true,
false).GetBitmapEx().GetBitmap()); false).GetBitmapEx());
if (bDoSuperSampling) if (bDoSuperSampling)
{ {
aPreview.Scale(rPixelSize, BmpScaleFlag::BestQuality); aPreview.Scale(rPixelSize, BmpScaleFlag::BestQuality);
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
BitmapFactory(); BitmapFactory();
~BitmapFactory(); ~BitmapFactory();
Bitmap CreateBitmap ( BitmapEx CreateBitmap (
const SdPage& rPage, const SdPage& rPage,
const Size& rPixelSize, const Size& rPixelSize,
const bool bDoSuperSampling); const bool bDoSuperSampling);
......
...@@ -78,13 +78,7 @@ void FramePainter::AdaptColor ( ...@@ -78,13 +78,7 @@ void FramePainter::AdaptColor (
// Get the source color. // Get the source color.
if (maCenter.maBitmap.IsEmpty()) if (maCenter.maBitmap.IsEmpty())
return; return;
Bitmap aBitmap = maCenter.maBitmap.GetBitmap(); const Color aSourceColor = maCenter.maBitmap.GetPixelColor(0,0);
Bitmap::ScopedReadAccess pReadAccess(aBitmap);
if (!pReadAccess)
return;
const BitmapColor aBmpSourceColor = pReadAccess->GetColor(0,0);
const Color aSourceColor = aBmpSourceColor.GetColor();
pReadAccess.reset();
// Erase the center bitmap. // Erase the center bitmap.
maCenter.maBitmap.SetEmpty(); maCenter.maBitmap.SetEmpty();
......
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