From 6f221adc31e8323284720e7ccfe4818430a9bd66 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 4 Oct 2012 07:40:24 +0200 Subject: Improve quality of page previews in Impress/Draw with supersampling Change-Id: I9c5b28fc32b73b2147162f74919b21d99401b501 --- sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx | 14 ++++++-------- sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx | 4 ++-- sd/source/ui/slidesorter/view/SlideSorterView.cxx | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx index 2d901efae1ce..6b31439680f4 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx @@ -41,10 +41,6 @@ #include #include -const static sal_Int32 gnSuperSampleFactor (2); -const static bool gbAllowSuperSampling (false); - - namespace sd { namespace slidesorter { namespace view { class SlideSorterView; class PageObjectViewObjectContact; @@ -73,10 +69,12 @@ Bitmap BitmapFactory::CreateBitmap ( const bool bDoSuperSampling) { Size aSize (rPixelSize); - if (bDoSuperSampling && gbAllowSuperSampling) + if (bDoSuperSampling) { - aSize.Width() *= gnSuperSampleFactor; - aSize.Height() *= gnSuperSampleFactor; + // Supersampling factor + int aSuperSamplingFactor = 2; + aSize.Width() *= aSuperSamplingFactor; + aSize.Height() *= aSuperSamplingFactor; } Bitmap aPreview (maRenderer.RenderPage ( @@ -85,7 +83,7 @@ Bitmap BitmapFactory::CreateBitmap ( String(), true, false).GetBitmapEx().GetBitmap()); - if (bDoSuperSampling && gbAllowSuperSampling) + if (bDoSuperSampling) { aPreview.Scale(rPixelSize, BMP_SCALE_BEST); } diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx index db3f12d377ab..27c263d1a35b 100644 --- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx @@ -147,7 +147,7 @@ Bitmap GenericPageCache::GetPreviewBitmap ( // i.e. the bitmap is not empty. if (bResize && aBitmapSize.Width()>0 && aBitmapSize.Height()>0) { - aPreview.Scale(maPreviewSize, BMP_SCALE_FAST); + aPreview.Scale(maPreviewSize); } bMayBeUpToDate = false; } @@ -184,7 +184,7 @@ Bitmap GenericPageCache::GetMarkedPreviewBitmap ( // i.e. the bitmap is not empty. if (aBitmapSize.Width()>0 && aBitmapSize.Height()>0) { - aMarkedPreview.Scale(maPreviewSize, BMP_SCALE_FAST); + aMarkedPreview.Scale(maPreviewSize); } } diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 23516a95b3a2..66c3cdf0d315 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -819,7 +819,7 @@ void SlideSorterView::ConfigurationChanged ( mpPreviewCache.reset( new cache::PageCache( mpLayouter->GetPageObjectSize(), - false, + true, cache::SharedCacheContext(new ViewCacheContext(mrSlideSorter)))); } -- cgit