diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 31a789e58253..ab8e48162c22 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -626,71 +626,6 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, if ( nMirrFlags ) aBmp.Mirror( nMirrFlags ); - /* #i75264# (corrected with #i81576#) - * sometimes a bitmap is scaled to a ridiculous size and drawn - * to a quite normal VDev, so only a very small part of - * the scaled bitmap will be visible. However actually scaling - * the bitmap will use so much memory that we end with a crash. - * Workaround: since only a small part of the scaled bitmap will - * be actually drawn anyway (because of clipping on the device - * boundary), limit the destination and source rectangles so - * that the destination rectangle will overlap the device but only - * be reasonably (say factor 2) larger than the device itself. - */ - if( aPosAry.mnDestWidth > 2048 || aPosAry.mnDestHeight > 2048 ) - { - if( meOutDevType == OUTDEV_WINDOW || - (meOutDevType == OUTDEV_VIRDEV && mpPDFWriter == 0 ) ) - { - // #i81576# do the following trick only if there is overlap at all - // else the formulae don't work - // theoretically in this case we wouldn't need to draw the bitmap at all - // however there are some esoteric case where that is needed - if( aPosAry.mnDestX + aPosAry.mnDestWidth >= 0 - && aPosAry.mnDestX < mnOutWidth - && aPosAry.mnDestY + aPosAry.mnDestHeight >= 0 - && aPosAry.mnDestY < mnOutHeight ) - { - // reduce scaling to something reasonable taking into account the output size - if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth ) - { - const double nScaleX = aPosAry.mnDestWidth/double(aPosAry.mnSrcWidth); - - if( aPosAry.mnDestX + aPosAry.mnDestWidth > mnOutWidth ) - { - aPosAry.mnDestWidth = Max(long(0),mnOutWidth-aPosAry.mnDestX); - } - if( aPosAry.mnDestX < 0 ) - { - aPosAry.mnDestWidth += aPosAry.mnDestX; - aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX); - aPosAry.mnDestX = 0; - } - - aPosAry.mnSrcWidth = sal::static_int_cast<long>(aPosAry.mnDestWidth / nScaleX); - } - - if( aPosAry.mnDestHeight > 3*mnOutHeight && aPosAry.mnSrcHeight != 0 ) - { - const double nScaleY = aPosAry.mnDestHeight/double(aPosAry.mnSrcHeight); - - if( aPosAry.mnDestY + aPosAry.mnDestHeight > mnOutHeight ) - { - aPosAry.mnDestHeight = Max(long(0),mnOutHeight-aPosAry.mnDestY); - } - if( aPosAry.mnDestY < 0 ) - { - aPosAry.mnDestHeight += aPosAry.mnDestY; - aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY); - aPosAry.mnDestY = 0; - } - - aPosAry.mnSrcHeight = sal::static_int_cast<long>(aPosAry.mnDestHeight / nScaleY); - } - } - } - } - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) { const double nScaleX = aPosAry.mnDestWidth / static_cast<double>( aPosAry.mnSrcWidth ); |