diff options
author | Herbert Duerr <hdu@openoffice.org> | 2009-11-09 09:30:56 +0000 |
---|---|---|
committer | Herbert Duerr <hdu@openoffice.org> | 2009-11-09 09:30:56 +0000 |
commit | dddba26a2f9e03f52980c555cad1303d13848c70 (patch) | |
tree | 3e1a855460848196eeb01ff3f65d47d26ff91fc2 /vcl | |
parent | 71b4a7f02742a949904070b1189b5560d68eaba7 (diff) |
#i105880# reset clip region of recycled render pictures
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/source/gdi/salgdi.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/source/gdi/xrender_peer.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/source/gdi/xrender_peer.hxx | 14 |
3 files changed, 28 insertions, 1 deletions
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 34f2dfd4b935..3349b27148cb 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1028,11 +1028,12 @@ BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG ) XID X11SalGraphics::GetXRenderPicture() { + XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); + if( !m_aRenderPicture ) { // check xrender support for matching visual // find a XRenderPictFormat compatible with the Drawable - XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); XRenderPictFormat* pVisualFormat = static_cast<XRenderPictFormat*>(GetXRenderFormat()); if( !pVisualFormat ) { @@ -1053,7 +1054,15 @@ XID X11SalGraphics::GetXRenderPicture() // TODO: avoid clipping if already set correctly if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ ); + else #endif + { + // reset clip region + // TODO: avoid clip reset if already done + XRenderPictureAttributes aAttr; + aAttr.clip_mask = None; + rRenderPeer.ChangePicture( m_aRenderPicture, CPClipMask, &aAttr ); + } return m_aRenderPicture; } diff --git a/vcl/unx/source/gdi/xrender_peer.cxx b/vcl/unx/source/gdi/xrender_peer.cxx index d8f2045c6fde..fc8de818fafd 100644 --- a/vcl/unx/source/gdi/xrender_peer.cxx +++ b/vcl/unx/source/gdi/xrender_peer.cxx @@ -142,6 +142,10 @@ void XRenderPeer::InitRenderLib() mpXRenderCreatePicture = (Picture(*)(Display*,Drawable,const XRenderPictFormat*, unsigned long,const XRenderPictureAttributes*))pFunc; + pFunc = osl_getAsciiFunctionSymbol( mpRenderLib, "XRenderChangePicture" ); + if( !pFunc ) return; + mpXRenderChangePicture = (void(*)(Display*,Picture,unsigned long,const XRenderPictureAttributes*))pFunc; + pFunc = osl_getAsciiFunctionSymbol( mpRenderLib, "XRenderSetPictureClipRegion" ); if( !pFunc ) return; mpXRenderSetPictureClipRegion = (void(*)(Display*,Picture,XLIB_Region))pFunc; diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx index f1e2fd77a273..27c8fb3dcaeb 100644 --- a/vcl/unx/source/gdi/xrender_peer.hxx +++ b/vcl/unx/source/gdi/xrender_peer.hxx @@ -66,6 +66,8 @@ public: const XRenderPictFormat& ) const; Picture CreatePicture( Drawable, const XRenderPictFormat*, unsigned long nDrawable, const XRenderPictureAttributes* ) const; + void ChangePicture( Picture, unsigned long nValueMask, + const XRenderPictureAttributes* ) const; void SetPictureClipRegion( Picture, XLIB_Region ) const; void CompositePicture( int nOp, Picture aSrc, Picture aMask, Picture aDst, int nXSrc, int nYSrc, int nXMask, int nYMask, @@ -103,6 +105,8 @@ private: Picture (*mpXRenderCreatePicture)(Display*,Drawable, const XRenderPictFormat*, unsigned long,const XRenderPictureAttributes*); + void (*mpXRenderChangePicture)(Display*,Picture, + unsigned long,const XRenderPictureAttributes*); void (*mpXRenderSetPictureClipRegion)(Display*,Picture,XLIB_Region); void (*mpXRenderFreePicture)(Display*,Picture); void (*mpXRenderComposite)(Display*,int,Picture,Picture,Picture, @@ -194,6 +198,16 @@ inline Picture XRenderPeer::CreatePicture( Drawable aDrawable, #endif } +inline void XRenderPeer::ChangePicture( Picture aPicture, + unsigned long nValueMask, const XRenderPictureAttributes* pRenderAttr ) const +{ +#ifdef XRENDER_LINK + XRenderChangePicture( mpDisplay, aPicture, nValueMask, pRenderAttr ); +#else + (*mpXRenderChangePicture)( mpDisplay, aPicture, nValueMask, pRenderAttr ); +#endif +} + inline void XRenderPeer::SetPictureClipRegion( Picture aPicture, XLIB_Region aXlibRegion ) const { |