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/Library_tk.mk | 6 ++++++ toolkit/inc/toolkit/awt/vclxtoolkit.hxx | 2 +- toolkit/source/awt/vclxtoolkit.cxx | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'toolkit') diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 1ba1efd4164d..ddcfa82f7a85 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -148,4 +148,10 @@ $(eval $(call gb_Library_use_libraries,tk,\ endif endif +ifeq ($(OS),ANDROID) +$(eval $(call gb_Library_use_libraries,tk,\ + libotouch \ +)) +endif + # vim: set noet sw=4 ts=4: diff --git a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx index dc085b810536..6192f8f329dc 100644 --- a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx +++ b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx @@ -129,7 +129,7 @@ public: ~VCLXToolkit(); // ::com::sun::star::awt::XToolkit2 - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int64 addressOfMemoryBufferForSharedArrayWrapper ) throw + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL 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); // ::com::sun::star::awt::XToolkit 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