Kaydet (Commit) 6f221adc authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Improve quality of page previews in Impress/Draw with supersampling

Change-Id: I9c5b28fc32b73b2147162f74919b21d99401b501
üst 1e6985da
...@@ -41,10 +41,6 @@ ...@@ -41,10 +41,6 @@
#include <vcl/bmpacc.hxx> #include <vcl/bmpacc.hxx>
#include <vcl/pngwrite.hxx> #include <vcl/pngwrite.hxx>
const static sal_Int32 gnSuperSampleFactor (2);
const static bool gbAllowSuperSampling (false);
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
class SlideSorterView; class SlideSorterView;
class PageObjectViewObjectContact; class PageObjectViewObjectContact;
...@@ -73,10 +69,12 @@ Bitmap BitmapFactory::CreateBitmap ( ...@@ -73,10 +69,12 @@ Bitmap BitmapFactory::CreateBitmap (
const bool bDoSuperSampling) const bool bDoSuperSampling)
{ {
Size aSize (rPixelSize); Size aSize (rPixelSize);
if (bDoSuperSampling && gbAllowSuperSampling) if (bDoSuperSampling)
{ {
aSize.Width() *= gnSuperSampleFactor; // Supersampling factor
aSize.Height() *= gnSuperSampleFactor; int aSuperSamplingFactor = 2;
aSize.Width() *= aSuperSamplingFactor;
aSize.Height() *= aSuperSamplingFactor;
} }
Bitmap aPreview (maRenderer.RenderPage ( Bitmap aPreview (maRenderer.RenderPage (
...@@ -85,7 +83,7 @@ Bitmap BitmapFactory::CreateBitmap ( ...@@ -85,7 +83,7 @@ Bitmap BitmapFactory::CreateBitmap (
String(), String(),
true, true,
false).GetBitmapEx().GetBitmap()); false).GetBitmapEx().GetBitmap());
if (bDoSuperSampling && gbAllowSuperSampling) if (bDoSuperSampling)
{ {
aPreview.Scale(rPixelSize, BMP_SCALE_BEST); aPreview.Scale(rPixelSize, BMP_SCALE_BEST);
} }
......
...@@ -147,7 +147,7 @@ Bitmap GenericPageCache::GetPreviewBitmap ( ...@@ -147,7 +147,7 @@ Bitmap GenericPageCache::GetPreviewBitmap (
// i.e. the bitmap is not empty. // i.e. the bitmap is not empty.
if (bResize && aBitmapSize.Width()>0 && aBitmapSize.Height()>0) if (bResize && aBitmapSize.Width()>0 && aBitmapSize.Height()>0)
{ {
aPreview.Scale(maPreviewSize, BMP_SCALE_FAST); aPreview.Scale(maPreviewSize);
} }
bMayBeUpToDate = false; bMayBeUpToDate = false;
} }
...@@ -184,7 +184,7 @@ Bitmap GenericPageCache::GetMarkedPreviewBitmap ( ...@@ -184,7 +184,7 @@ Bitmap GenericPageCache::GetMarkedPreviewBitmap (
// i.e. the bitmap is not empty. // i.e. the bitmap is not empty.
if (aBitmapSize.Width()>0 && aBitmapSize.Height()>0) if (aBitmapSize.Width()>0 && aBitmapSize.Height()>0)
{ {
aMarkedPreview.Scale(maPreviewSize, BMP_SCALE_FAST); aMarkedPreview.Scale(maPreviewSize);
} }
} }
......
...@@ -819,7 +819,7 @@ void SlideSorterView::ConfigurationChanged ( ...@@ -819,7 +819,7 @@ void SlideSorterView::ConfigurationChanged (
mpPreviewCache.reset( mpPreviewCache.reset(
new cache::PageCache( new cache::PageCache(
mpLayouter->GetPageObjectSize(), mpLayouter->GetPageObjectSize(),
false, true,
cache::SharedCacheContext(new ViewCacheContext(mrSlideSorter)))); cache::SharedCacheContext(new ViewCacheContext(mrSlideSorter))));
} }
......
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