Kaydet (Commit) 0c10b8ff authored tarafından Luboš Luňák's avatar Luboš Luňák

make it possible to cache the resulting pixmap with a metafile

If the metafile contains just one single bitmap, the drawing code
optimizes by just using that one bitmap. It (=the resulting pixmap
after scaling etc.) however has not been cached so far, which means
smoothscaling (to be done) would be quite slow with every paint.

Change-Id: I30950c55fbadfddedc7df31283c66ed064b1a1a6
üst a83bf946
...@@ -536,6 +536,7 @@ static BitmapEx checkMetadataBitmap( const BitmapEx& rBmpEx, ...@@ -536,6 +536,7 @@ static BitmapEx checkMetadataBitmap( const BitmapEx& rBmpEx,
const Size& rRefSize, const Size& rRefSize,
bool& o_rbNonBitmapActionEncountered ) bool& o_rbNonBitmapActionEncountered )
{ {
// NOTE: If you do changes in this function, change checkMetadataBitmap() in grfcache.cxx too.
BitmapEx aBmpEx; BitmapEx aBmpEx;
if( rSrcSize == Size()) if( rSrcSize == Size())
rSrcSize = rBmpEx.GetSizePixel(); rSrcSize = rBmpEx.GetSizePixel();
...@@ -609,6 +610,9 @@ sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, ...@@ -609,6 +610,9 @@ sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const MapMode rPrefMapMode( rMtf.GetPrefMapMode() ); const MapMode rPrefMapMode( rMtf.GetPrefMapMode() );
const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) ); const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) );
// NOTE: If you do changes in this function, check GraphicDisplayCacheEntry::IsCacheableAsBitmap
// in grfcache.cxx too.
// Determine whether the metafile basically displays // Determine whether the metafile basically displays
// a single bitmap (in which case that bitmap is simply used directly // a single bitmap (in which case that bitmap is simply used directly
// instead of playing the metafile). Note that // instead of playing the metafile). Note that
......
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