[ooo-build-commit] 2 commits - patches/dev300 patches/emf+

Petr Mladek pmladek at kemper.freedesktop.org
Tue Nov 10 03:25:28 PST 2009


 patches/dev300/apply                   |   10 +
 patches/dev300/system-neon-fix.diff    |   29 +++++
 patches/emf+/emf+-vcl-renderer-m2.diff |  180 +++++++++++++++++++++++++++++++++
 patches/emf+/emf+-vcl-renderer.diff    |   34 +++---
 4 files changed, 238 insertions(+), 15 deletions(-)

New commits:
commit f1ff7305580840ac4d6c47ae7fbe118710e6bec0
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Nov 10 11:26:51 2009 +0100

    Apply emf+-vcl-renderer.diff corretly in ooo320-m4
    
    * patches/emf+/emf+-vcl-renderer-m2.diff:
    * patches/emf+/emf+-vcl-renderer.diff:
    * patches/dev300/apply: update for ooo320-m4 to aplly correctly

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 67d44cc..4ea106d 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2672,7 +2672,13 @@ emf+-cppcanvas-renderer.diff
 emf+-cppcanvas-emfplus.diff
 emf+-offapi-renderer.diff
 emf+-vcl-bitmap.diff
+
+[ EMFPlus > dev300-m62 > ooo320-m2 ]
 emf+-vcl-renderer.diff
+[ EMFPlus  <= dev300-m62 <= ooo320-m2 ]
+emf+-vcl-renderer-m2.diff
+
+[ EMFPlus ]
 emf+-svtools.diff
 emf+-scp2-renderer.diff
 emf+-crash-fix.diff, n#361534, rodo
diff --git a/patches/emf+/emf+-vcl-renderer-m2.diff b/patches/emf+/emf+-vcl-renderer-m2.diff
new file mode 100644
index 0000000..9b7442c
--- /dev/null
+++ b/patches/emf+/emf+-vcl-renderer-m2.diff
@@ -0,0 +1,180 @@
+--- vcl/inc/vcl/gdimtf.hxx.old	2009-04-02 10:44:25.000000000 +0000
++++ vcl/inc/vcl/gdimtf.hxx	2009-04-06 16:42:16.000000000 +0000
+@@ -138,6 +138,7 @@ private:
+                                                       const OutputDevice&   rMapDev,
+                                                       const PolyPolygon&    rPolyPoly,
+                                                       const Gradient&	  	rGrad 		);
++	SAL_DLLPRIVATE bool			   ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
+ 
+ //#endif // __PRIVATE
+ 
+--- vcl/source/gdi/gdimtf.cxx.old	2009-04-02 10:44:19.000000000 +0000
++++ vcl/source/gdi/gdimtf.cxx	2009-04-06 16:42:16.000000000 +0000
+@@ -38,12 +38,24 @@
+ #include <vcl/salbtype.hxx>
+ #include <vcl/outdev.hxx>
+ #include <vcl/window.hxx>
+-#ifndef _SV_CVTSVM_HXX
+ #include <vcl/cvtsvm.hxx>
+-#endif
+ #include <vcl/virdev.hxx>
++#include <vcl/salbmp.hxx>
++#include <vcl/svapp.hxx>
++#include <vcl/svdata.hxx>
++#include <vcl/salinst.hxx>
+ #include <vcl/gdimtf.hxx>
+ #include <vcl/graphictools.hxx>
++#include <vcl/canvastools.hxx>
++#include <vcl/unohelp.hxx>
++
++#include <com/sun/star/beans/XFastPropertySet.hpp>
++#include <com/sun/star/rendering/XCanvas.hpp>
++#include <com/sun/star/rendering/MtfRenderer.hpp>
++#include <comphelper/processfactory.hxx>
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++
++using namespace com::sun::star;
+ 
+ // -----------
+ // - Defines -
+@@ -478,6 +490,76 @@ void GDIMetaFile::Play( OutputDevice* pO
+ 
+ // ------------------------------------------------------------------------
+ 
++bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize )
++{
++    const Window* win = dynamic_cast <Window*> ( pOut );
++
++    if (!win)
++        win = Application::GetActiveTopWindow();
++    if (!win)
++        win = Application::GetFirstTopLevelWindow();
++
++    if (win) {
++        const uno::Reference<rendering::XCanvas>& xCanvas = win->GetCanvas ();
++        Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
++        const uno::Reference<rendering::XBitmap>& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
++        uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
++        if( xFactory.is() && xBitmap.is () ) {
++            uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
++            uno::Sequence< uno::Any > args (1);
++            uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
++            if( xBitmapCanvas.is() ) {
++                args[0] = uno::Any( xBitmapCanvas );
++                xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ),
++                                                                         args ), uno::UNO_QUERY );
++                
++                if( xMtfRenderer.is() ) {
++                    xBitmapCanvas->clear();
++                    uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
++                    if( xMtfFastPropertySet.is() )
++                        // set this metafile to the renderer to
++                        // speedup things (instead of copying data to
++                        // sequence of bytes passed to renderer)
++                        xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast<sal_Int64>( this ) ) );
++
++                    xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );
++
++                    uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
++                    if( xFastPropertySet.get() ) {
++                        // 0 means get BitmapEx
++                        uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
++                        BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue()); 
++                        if( pBitmapEx ) {
++                            pOut->DrawBitmapEx( rPos, *pBitmapEx );
++                            delete pBitmapEx;
++                            return true;
++                        }
++                    }
++                    
++                    SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
++                    SalBitmap* pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
++
++                    if( pSalBmp->Create( xBitmapCanvas, aSize ) && pSalMask->Create( xBitmapCanvas, aSize, true ) ) {
++                        Bitmap aBitmap( pSalBmp );
++                        Bitmap aMask( pSalMask );
++                        AlphaMask aAlphaMask( aMask );
++                        BitmapEx aBitmapEx( aBitmap, aAlphaMask );
++                        pOut->DrawBitmapEx( rPos, aBitmapEx );
++                        return true;
++                    }
++
++                    delete pSalBmp;
++                    delete pSalMask;
++                }
++            }
++        }
++    }
++
++    return false;
++}
++
++// ------------------------------------------------------------------------
++
+ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
+ 						const Size& rSize, ULONG nPos )
+ {
+@@ -487,8 +569,12 @@ void GDIMetaFile::Play( OutputDevice* pO
+ 
+ 	if( aDestSize.Width() && aDestSize.Height() )
+ 	{
+-		Size			aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+-		GDIMetaFile*	pMtf = pOut->GetConnectMetaFile();
++        GDIMetaFile*	pMtf = pOut->GetConnectMetaFile();
++
++        if( !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
++            return;
++
++        Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+ 
+ 		if( !aTmpPrefSize.Width() )
+ 			aTmpPrefSize.Width() = aDestSize.Width();
+--- vcl/source/gdi/makefile.mk.old	2009-04-06 16:41:56.000000000 +0000
++++ vcl/source/gdi/makefile.mk	2009-04-06 16:42:16.000000000 +0000
+@@ -118,6 +118,7 @@ EXCEPTIONSFILES=	$(SLO)$/salmisc.obj 	\
+ 			$(SLO)$/bitmapex.obj	\
+                     $(SLO)$/outdev.obj		\
+ 					$(SLO)$/outdev3.obj 	\
++					$(SLO)$/gdimtf.obj 	\
+ 					$(SLO)$/gfxlink.obj		\
+ 					$(SLO)$/print.obj		\
+                     $(SLO)$/print2.obj		\
+--- vcl/source/gdi/metaact.cxx.old	2009-04-02 10:44:19.000000000 +0000
++++ vcl/source/gdi/metaact.cxx	2009-04-06 16:42:16.000000000 +0000
+@@ -4093,8 +4093,34 @@ void MetaCommentAction::Scale( double fX
+ 				}
+ 				delete[] mpData;
+ 				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+-			}
+-		}
++            } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
++				SvMemoryStream	aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
++				SvMemoryStream	aDest;
++
++                sal_Int32 nLeft, nRight, nTop, nBottom;
++                sal_Int32 nPixX, nPixY, nMillX, nMillY;
++                float m11, m12, m21, m22, mdx, mdy;
++
++                // read data
++                aMemStm >> nLeft >> nTop >> nRight >> nBottom;
++                aMemStm >> nPixX >> nPixY >> nMillX >> nMillY;
++                aMemStm >> m11 >> m12 >> m21 >> m22 >> mdx >> mdy;
++
++                // add scale to the transformation
++                m11 *= fXScale;
++                m12 *= fXScale;
++                m22 *= fYScale;
++                m21 *= fYScale;
++
++                // prepare new data
++                aDest << nLeft << nTop << nRight << nBottom;
++                aDest << nPixX << nPixY << nMillX << nMillY;
++                aDest << m11 << m12 << m21 << m22 << mdx << mdy;
++
++                // save them
++				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
++            }
++        }
+ 	}
+ }
+ 
diff --git a/patches/emf+/emf+-vcl-renderer.diff b/patches/emf+/emf+-vcl-renderer.diff
index 9b7442c..e486630 100644
--- a/patches/emf+/emf+-vcl-renderer.diff
+++ b/patches/emf+/emf+-vcl-renderer.diff
@@ -139,17 +139,23 @@
  					$(SLO)$/gfxlink.obj		\
  					$(SLO)$/print.obj		\
                      $(SLO)$/print2.obj		\
---- vcl/source/gdi/metaact.cxx.old	2009-04-02 10:44:19.000000000 +0000
-+++ vcl/source/gdi/metaact.cxx	2009-04-06 16:42:16.000000000 +0000
-@@ -4093,8 +4093,34 @@ void MetaCommentAction::Scale( double fX
- 				}
- 				delete[] mpData;
- 				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
--			}
--		}
+--- vcl/source/gdi/metaact.cxx.old	2009-11-05 16:00:58.000000000 +0100
++++ vcl/source/gdi/metaact.cxx	2009-11-10 11:22:39.000000000 +0100
+@@ -4085,6 +4085,7 @@ void MetaCommentAction::Move( long nXMov
+ // SJ: 25.07.06 #i56656# we are not able to mirrorcertain kind of
+ // comments properly, especially the XPATHSTROKE and XPATHFILL lead to
+ // problems, so it is better to remove these comments when mirroring
++// FIXME: fake comment to apply the next hunk in the right location
+ void MetaCommentAction::Scale( double fXScale, double fYScale )
+ {
+     if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
+@@ -4118,6 +4119,32 @@ void MetaCommentAction::Scale( double fX
+                 }
+                 delete[] mpData;
+                 ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
 +            } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
-+				SvMemoryStream	aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
-+				SvMemoryStream	aDest;
++                SvMemoryStream	aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
++                SvMemoryStream	aDest;
 +
 +                sal_Int32 nLeft, nRight, nTop, nBottom;
 +                sal_Int32 nPixX, nPixY, nMillX, nMillY;
@@ -173,8 +179,6 @@
 +
 +                // save them
 +				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
-+            }
-+        }
- 	}
- }
- 
+             }
+         }
+     }
commit 2a4d87def668e622ce0d405d978f68e8627469bc
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Nov 10 11:14:24 2009 +0100

    Build with system neon on ooo320 >= m4; fix from Rene (i#106757)
    
    * patches/dev300/system-neon-fix.diff:
    * patches/dev300/apply: fix build with system neon on ooo320 >= m4; patch by
      Rene (i#106757)

diff --git a/patches/dev300/apply b/patches/dev300/apply
index d842d87..67d44cc 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1137,6 +1137,10 @@ ia64-nss-m1.diff, i#105899
 # fix ia64 nss build
 ia64-nss.diff, i#105899
 
+[ BuildBits >= ooo320-m4 >= dev300-m63 ]
+# build with system neon
+system-neon-fix.diff, i#106757, rengelha
+
 [ BuildBits ]
 # use the link flags from the pkgconfig when using the system cairo
 cancas-cairo-linkflags.diff, i#105834, pmladek
diff --git a/patches/dev300/system-neon-fix.diff b/patches/dev300/system-neon-fix.diff
new file mode 100644
index 0000000..90c2fc5
--- /dev/null
+++ b/patches/dev300/system-neon-fix.diff
@@ -0,0 +1,29 @@
+Index: scp2/source/ooo/makefile.mk
+===================================================================
+--- scp2/source/ooo/makefile.mk	(Revision 277420)
++++ scp2/source/ooo/makefile.mk	(Arbeitskopie)
+@@ -212,6 +212,9 @@
+ .IF "$(DISABLE_NEON)" == "TRUE"
+ SCPDEFS+=-DDISABLE_NEON
+ .ENDIF
++.IF "$(SYSTEM_NEON)" == "YES"
++SCPDEFS+=-DSYSTEM_NEON
++.ENDIF
+ 
+ # if yes or unset (neon not used) -> do not install openssl library!
+ .IF $(SYSTEM_OPENSSL) != "YES"
+Index: source/ooo/file_library_ooo.scp
+===================================================================
+--- scp2/source/ooo/file_library_ooo.scp	(Revision 277420)
++++ scp2/source/ooo/file_library_ooo.scp	(Arbeitskopie)
+@@ -1547,8 +1547,10 @@
+ 
+ #ifndef DISABLE_NEON
+ SPECIAL_UNO_LIB_FILE(gid_File_Lib_Ucpdav1,ucpdav1)
++#ifndef SYSTEM_NEON
+ SPECIAL_LIB_FILE(gid_File_Lib_Neon,neon)
+ #endif
++#endif
+ 
+ SPECIAL_UNO_LIB_FILE_PATCH(gid_File_Lib_Ucpfile1,ucpfile1)
+ 


More information about the ooo-build-commit mailing list