From daaa550121a97d80e1ab43cbd5c73da6915e4ac4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 18 Jun 2012 22:32:35 +0300 Subject: Pass also scale and offset to createScreenCompatibleDeviceUsingBuffer() Pass on to VirtualDevice where used to set the MapMode of the device appropriately. Adapt DocumentLoader, use to scale the page rendering to exactly fit the virtual device. Change-Id: I4b0bc67e12114d3d9d493ff1aca2ef5d2cc78912 --- toolkit/source/awt/vclxtoolkit.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'toolkit/source/awt/vclxtoolkit.cxx') diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index c799393daac7..e027b235a21f 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -567,10 +567,10 @@ void SAL_CALL VCLXToolkit::disposing() ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXToolkit::createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException) { - return createScreenCompatibleDeviceUsingBuffer( Width, Height, 0 ); + return createScreenCompatibleDeviceUsingBuffer( Width, Height, 1, 1, 0, 0, 0 ); } -::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXToolkit::createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int64 addressOfMemoryBufferForSharedArrayWrapper ) throw(::com::sun::star::uno::RuntimeException) +::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXToolkit::createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int32 ScaleNumerator, sal_Int32 ScaleDenominator, sal_Int32 XOffset, sal_Int32 YOffset, sal_Int64 addressOfMemoryBufferForSharedArrayWrapper ) throw(::com::sun::star::uno::RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); @@ -583,7 +583,8 @@ void SAL_CALL VCLXToolkit::disposing() if ( addressOfMemoryBufferForSharedArrayWrapper != 0 ) { #if defined(ANDROID) ByteBufferWrapper *bbw = (ByteBufferWrapper *) (intptr_t) addressOfMemoryBufferForSharedArrayWrapper; - pV->SetOutputSizePixelAndBuffer( Size( Width, Height ), basebmp::RawMemorySharedArray( bbw->pointer(), *bbw )); + pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ), Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset), basebmp::RawMemorySharedArray( bbw->pointer(), *bbw )); +#else OSL_FAIL( "rendering to a pre-allocated buffer not done yet for this OS" ); #endif } else { -- cgit