cui/uiconfig/ui/optmemorypage.ui | 9 + drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 10 - include/vcl/graph.hxx | 6 svtools/source/graphic/grfcache.cxx | 3 svtools/source/graphic/grfmgr2.cxx | 11 - vcl/inc/impgraph.hxx | 7 vcl/source/gdi/graph.cxx | 15 -- vcl/source/gdi/impgraph.cxx | 119 +++++----------- vcl/source/opengl/OpenGLContext.cxx | 28 ++- 9 files changed, 76 insertions(+), 132 deletions(-)
New commits: commit a87b1b07b91960601c7f39e2b40eba8ad50b1667 Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Fri Nov 21 11:08:13 2014 +0100 Don't use a hard coded limit for size based auto swap out. Now the graphic cache settings shows the real memory usage for the users, so we can bequeth the decision of the limit to them. Default is 200 MB. See also: dbdacc73ae154237314d599194cc686bd738a9bf Change-Id: I463d31254f6f1836e1584d5acd692f38a97bfe39 diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 3b6a738..f469623 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -200,15 +200,8 @@ namespace void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGraphicToIgnore) { // detect maximum allowed memory footprint. Use the user-settings of MaxCacheSize (defaulted - // to 200MB). Limit to a useful maximum for 32Bit address space - - // max at 500MB; I experimented with 800 for debug and 750 for non-debug settings (pics start - // missing when office reaches a mem footprint of 1.5GB) but some secure left over space for - // app activity is needed - static sal_uLong aMaxSize32Bit(500 * 1024 * 1024); - - // calc max allowed cache size - const sal_uLong nMaxCacheSize(::std::min(GetMaxCacheSize(), aMaxSize32Bit)); + // to 200MB). + const sal_uLong nMaxCacheSize(GetMaxCacheSize()); if(mnUsedSize > nMaxCacheSize) { commit 356006b4967fad26c7edd2126860abf01206fdbd Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Fri Nov 21 11:04:37 2014 +0100 Do not limit graphic cache size setting to 256 MB. Change-Id: I62835721225cc39dd9fd5131843d57497794be95 diff --git a/cui/uiconfig/ui/optmemorypage.ui b/cui/uiconfig/ui/optmemorypage.ui index 4646cda..d17f5ea 100644 --- a/cui/uiconfig/ui/optmemorypage.ui +++ b/cui/uiconfig/ui/optmemorypage.ui @@ -23,6 +23,13 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment4"> + <property name="lower">1</property> + <property name="upper">4096</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkBox" id="OptMemoryPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -182,7 +189,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">â¢</property> - <property name="adjustment">adjustment2</property> + <property name="adjustment">adjustment4</property> </object> <packing> <property name="left_attach">1</property> commit c35fae3f6b15221701cadfca3132803695607660 Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Thu Nov 20 12:25:16 2014 +0100 fdo#81643: Regression in rendering of borders Regerssion from: 6a3fb868b2b8af21f7b6140424b6f8377599a786 The new tryDrawBorderLinePrimitive2DDirect() draws rectangles, but borders are assumed to be trapezoids. So simple comment this out and use the original drawing method. Change-Id: I755d5f0b3621bfc4c999ee994a375d4e5ebbcdf0 diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index d287739..3ad7aba 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -275,7 +275,7 @@ namespace drawinglayer return bTryWorked; } - +/* bool VclPixelProcessor2D::tryDrawBorderLinePrimitive2DDirect( const drawinglayer::primitive2d::BorderLinePrimitive2D& rSource) { @@ -610,7 +610,7 @@ namespace drawinglayer } return false; } - +*/ void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { switch(rCandidate.getPrimitive2DID()) @@ -1226,10 +1226,10 @@ namespace drawinglayer sal_uInt16 nAntiAliasing = mpOutputDevice->GetAntialiasing(); mpOutputDevice->SetAntialiasing(nAntiAliasing & ~ANTIALIASING_ENABLE_B2DDRAW); - const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder = - static_cast<const drawinglayer::primitive2d::BorderLinePrimitive2D&>(rCandidate); + //const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder = + //static_cast<const drawinglayer::primitive2d::BorderLinePrimitive2D&>(rCandidate); - if (!tryDrawBorderLinePrimitive2DDirect(rBorder)) + //if (!tryDrawBorderLinePrimitive2DDirect(rBorder)) process(rCandidate.get2DDecomposition(getViewInformation2D())); mpOutputDevice->SetAntialiasing(nAntiAliasing); commit d85b975667dfba755b9c952a2b8030a7f33bba66 Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Thu Nov 20 12:07:10 2014 +0100 OpenGLContext stopped to support multisampling under linux. glTF rendering needs to have a context with multisampling so it also became broken. Regresssion from: 07c0396ab9c94be5af392827f56f0d91551f3e25 This breaker change was made assuming getVisual{Info}() is always called after the SystemChildWindow is already created, but generateWinData() is run as part of the new child window creation. It's aim to choose the best visual / FBConfig which potentially support multisampling. Change-Id: Ic881c6769260b5eaa9fed2552eca882191f6c56d diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index d1c1b72..dac3b5c 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -463,8 +463,7 @@ GLXFBConfig* getFBConfigForPixmap(Display* dpy, int& nBestFBC, bool bUseDoubleBu return pFBC; } -#ifdef DBG_UTIL -GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubleBufferedRendering) +GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubleBufferedRendering, bool bWithSameVisualID) { if( dpy == 0 || !glXQueryExtension( dpy, NULL, NULL ) ) return NULL; @@ -513,7 +512,7 @@ GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubl for(int i = 0; i < fbCount; ++i) { XVisualInfo* pVi = glXGetVisualFromFBConfig( dpy, pFBC[i] ); - if(pVi && pVi->visualid == xattr.visual->visualid) + if(pVi && (!bWithSameVisualID || pVi->visualid == xattr.visual->visualid) ) { // pick the one with the most samples per pixel int nSampleBuf = 0; @@ -532,7 +531,6 @@ GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubl return pFBC; } -#endif // we need them before glew can initialize them // glew needs an OpenGL context so we need to get the address manually @@ -662,7 +660,7 @@ bool OpenGLContext::ImplInit() if (!mbPixmap && glXCreateContextAttribsARB && !mbRequestLegacyContext) { int best_fbc = -1; - GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc, mbUseDoubleBufferedRendering); + GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc, mbUseDoubleBufferedRendering, true); if (!pFBC) return false; @@ -1140,7 +1138,25 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool) if( dpy == 0 || !glXQueryExtension( dpy, NULL, NULL ) ) return aWinData; - aWinData.pVisual = getVisual(dpy, win); + initOpenGLFunctionPointers(); + + int best_fbc = -1; + GLXFBConfig* pFBC = getFBConfig(dpy, win, best_fbc, true, false); + + if (!pFBC) + return aWinData; + + XVisualInfo* vi = 0; + if( best_fbc != -1 ) + vi = glXGetVisualFromFBConfig( dpy, pFBC[best_fbc] ); + + XFree(pFBC); + + if( vi ) + { + SAL_INFO("vcl.opengl", "using VisualID " << vi->visualid); + aWinData.pVisual = (void*)(vi->visual); + } return aWinData; } commit 577bfd169c0eb031aabcbb7c93f28a5c92366502 Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Wed Nov 19 14:24:57 2014 +0100 maDocFileURLStr is always empty Change-Id: I34c4a44d4fbe8d721a3a0bda5dbe35c68fe15c13 diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 8727b9c..1111dd4 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -170,12 +170,6 @@ public: GraphicReader* GetContext(); void SetContext( GraphicReader* pReader ); -public: - - void SetDocFileName( const OUString& rName, sal_uLong nFilePos ); - const OUString& GetDocFileName() const; - sal_uLong GetDocFilePos() const; - private: friend class GraphicObject; bool SwapOut(); diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index ca4347e..ef025e3 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -265,8 +265,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) const Size aPrefSize( rSubstitute.GetPrefSize() ); const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() ); const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() ); - const OUString aDocFileName( rSubstitute.GetDocFileName() ); - const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos(); const GraphicType eOldType = rSubstitute.GetType(); const bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); @@ -299,7 +297,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) rSubstitute.SetPrefSize( aPrefSize ); rSubstitute.SetPrefMapMode( aPrefMapMode ); rSubstitute.SetAnimationNotifyHdl( aAnimationNotifyHdl ); - rSubstitute.SetDocFileName( aDocFileName, nDocFilePos ); } if( GFX_LINK_TYPE_NONE != maGfxLink.GetType() ) diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index f376603..29a53c5 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -56,8 +56,6 @@ private: ImpSwapFile* mpSwapFile; GfxLink* mpGfxLink; GraphicType meType; - OUString maDocFileURLStr; - sal_uLong mnDocFilePos; mutable sal_uLong mnSizeBytes; sal_uLong mnRefCount; bool mbSwapOut; @@ -131,11 +129,6 @@ private: void ImplSetContext( GraphicReader* pReader ); private: - - void ImplSetDocFileName( const OUString& rName, sal_uLong nFilePos ); - const OUString& ImplGetDocFileName() const; - sal_uLong ImplGetDocFilePos() const { return mnDocFilePos;} - bool ImplReadEmbedded( SvStream& rIStream ); bool ImplWriteEmbedded( SvStream& rOStream ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 2e39e5e..80522e7 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -501,21 +501,6 @@ void Graphic::SetContext( GraphicReader* pReader ) mpImpGraphic->ImplSetContext( pReader ); } -void Graphic::SetDocFileName( const OUString& rName, sal_uLong nFilePos ) -{ - mpImpGraphic->ImplSetDocFileName( rName, nFilePos ); -} - -const OUString& Graphic::GetDocFileName() const -{ - return mpImpGraphic->ImplGetDocFileName(); -} - -sal_uLong Graphic::GetDocFilePos() const -{ - return mpImpGraphic->ImplGetDocFilePos(); -} - bool Graphic::SwapOut() { ImplTestRefCount(); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 27bd0b9..bb31b81 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -95,7 +95,6 @@ ImpGraphic::ImpGraphic() : mpSwapFile ( NULL ), mpGfxLink ( NULL ), meType ( GRAPHIC_NONE ), - mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -109,8 +108,6 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) : mpContext ( NULL ), mpSwapFile ( rImpGraphic.mpSwapFile ), meType ( rImpGraphic.meType ), - maDocFileURLStr ( rImpGraphic.maDocFileURLStr ), - mnDocFilePos ( rImpGraphic.mnDocFilePos ), mnSizeBytes ( rImpGraphic.mnSizeBytes ), mnRefCount ( 1UL ), mbSwapOut ( rImpGraphic.mbSwapOut ), @@ -142,7 +139,6 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) : mpSwapFile ( NULL ), mpGfxLink ( NULL ), meType ( GRAPHIC_BITMAP ), - mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -157,7 +153,6 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : mpSwapFile ( NULL ), mpGfxLink ( NULL ), meType ( GRAPHIC_BITMAP ), - mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -171,7 +166,6 @@ ImpGraphic::ImpGraphic(const SvgDataPtr& rSvgDataPtr) mpSwapFile( NULL ), mpGfxLink( NULL ), meType( rSvgDataPtr.get() ? GRAPHIC_BITMAP : GRAPHIC_NONE ), - mnDocFilePos( 0UL ), mnSizeBytes( 0UL ), mnRefCount( 1UL ), mbSwapOut( false ), @@ -187,7 +181,6 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) : mpSwapFile ( NULL ), mpGfxLink ( NULL ), meType ( GRAPHIC_BITMAP ), - mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -202,7 +195,6 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) : mpSwapFile ( NULL ), mpGfxLink ( NULL ), meType ( GRAPHIC_GDIMETAFILE ), - mnDocFilePos ( 0UL ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -244,8 +236,6 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) if( !mbSwapUnderway ) { - maDocFileURLStr = rImpGraphic.maDocFileURLStr; - mnDocFilePos = rImpGraphic.mnDocFilePos; mbSwapOut = rImpGraphic.mbSwapOut; mpSwapFile = rImpGraphic.mpSwapFile; @@ -393,8 +383,6 @@ void ImpGraphic::ImplClear() } mbSwapOut = false; - mnDocFilePos = 0UL; - maDocFileURLStr.clear(); // cleanup ImplClearGraphics( false ); @@ -953,22 +941,6 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader ) mpContext = pReader; } -void ImpGraphic::ImplSetDocFileName( const OUString& rName, sal_uLong nFilePos ) -{ - const INetURLObject aURL( rName ); - - DBG_ASSERT( rName.isEmpty() || ( aURL.GetProtocol() != INET_PROT_NOT_VALID ), "Graphic::SetDocFileName(...): invalid URL" ); - - maDocFileURLStr = aURL.GetMainURL( INetURLObject::NO_DECODE ); - mnDocFilePos = nFilePos; -} - -const OUString& ImpGraphic::ImplGetDocFileName() const -{ - return maDocFileURLStr; -} - - bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) { MapMode aMapMode; @@ -1184,66 +1156,58 @@ bool ImpGraphic::ImplSwapOut() if( !ImplIsSwapOut() ) { - if (maDocFileURLStr.isEmpty()) - { - ::utl::TempFile aTempFile; - const INetURLObject aTmpURL( aTempFile.GetURL() ); + ::utl::TempFile aTempFile; + const INetURLObject aTmpURL( aTempFile.GetURL() ); - if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() ) + if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() ) + { + boost::scoped_ptr<SvStream> pOStm; + try { - boost::scoped_ptr<SvStream> pOStm; - try - { - pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE )); - } - catch( const ::com::sun::star::uno::Exception& ) + pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE )); + } + catch( const ::com::sun::star::uno::Exception& ) + { + } + if( pOStm ) + { + pOStm->SetVersion( SOFFICE_FILEFORMAT_50 ); + pOStm->SetCompressMode( COMPRESSMODE_NATIVE ); + + if( ( bRet = ImplSwapOut( pOStm.get() ) ) ) { + mpSwapFile = new ImpSwapFile; + mpSwapFile->nRefCount = 1; + mpSwapFile->aSwapURL = aTmpURL; } - if( pOStm ) + else { - pOStm->SetVersion( SOFFICE_FILEFORMAT_50 ); - pOStm->SetCompressMode( COMPRESSMODE_NATIVE ); + pOStm.reset(); - if( ( bRet = ImplSwapOut( pOStm.get() ) ) ) + try { - mpSwapFile = new ImpSwapFile; - mpSwapFile->nRefCount = 1; - mpSwapFile->aSwapURL = aTmpURL; + ::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), + comphelper::getProcessComponentContext() ); + + aCnt.executeCommand( OUString("delete"), + ::com::sun::star::uno::makeAny( true ) ); } - else + catch( const ::com::sun::star::ucb::ContentCreationException& ) + { + } + catch( const ::com::sun::star::uno::RuntimeException& ) + { + } + catch( const ::com::sun::star::ucb::CommandAbortedException& ) + { + } + catch( const ::com::sun::star::uno::Exception& ) { - pOStm.reset(); - - try - { - ::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), - comphelper::getProcessComponentContext() ); - - aCnt.executeCommand( OUString("delete"), - ::com::sun::star::uno::makeAny( true ) ); - } - catch( const ::com::sun::star::ucb::ContentCreationException& ) - { - } - catch( const ::com::sun::star::uno::RuntimeException& ) - { - } - catch( const ::com::sun::star::ucb::CommandAbortedException& ) - { - } - catch( const ::com::sun::star::uno::Exception& ) - { - } } } } } - else - { - ImplClearGraphics( true ); - bRet = mbSwapOut = true; - } } return bRet; @@ -1292,8 +1256,6 @@ bool ImpGraphic::ImplSwapIn() if( mpSwapFile ) aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE ); - else - aSwapURL = maDocFileURLStr; if( !aSwapURL.isEmpty() ) { @@ -1311,9 +1273,6 @@ bool ImpGraphic::ImplSwapIn() pIStm->SetVersion( SOFFICE_FILEFORMAT_50 ); pIStm->SetCompressMode( COMPRESSMODE_NATIVE ); - if( !mpSwapFile ) - pIStm->Seek( mnDocFilePos ); - bRet = ImplSwapIn( pIStm.get() ); pIStm.reset();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits