diff options
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 49 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 29 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 3 |
3 files changed, 59 insertions, 22 deletions
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index 2098457b9e1e..18ca15ece773 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -52,7 +52,6 @@ #include "generic/printergfx.hxx" #include "xrender_peer.hxx" -#include "region.h" #define STATIC_POINTS 64 @@ -559,24 +558,48 @@ bool X11SalGraphics::setClipRegion( const Region& i_rClip ) XDestroyRegion( mpClipRegion ); mpClipRegion = XCreateRegion(); - ImplRegionInfo aInfo; - long nX, nY, nW, nH; - bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); - while( bRegionRect ) + RectangleVector aRectangles; + i_rClip.GetRegionRectangles(aRectangles); + + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) { - if ( nW && nH ) + const long nW(aRectIter->GetWidth()); + + if(nW) { - XRectangle aRect; - aRect.x = (short)nX; - aRect.y = (short)nY; - aRect.width = (unsigned short)nW; - aRect.height = (unsigned short)nH; + const long nH(aRectIter->GetHeight()); + + if(nH) + { + XRectangle aRect; - XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion ); + aRect.x = (short)aRectIter->Left(); + aRect.y = (short)aRectIter->Top(); + aRect.width = (unsigned short)nW; + aRect.height = (unsigned short)nH; + XUnionRectWithRegion(&aRect, mpClipRegion, mpClipRegion); + } } - bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); } + //ImplRegionInfo aInfo; + //long nX, nY, nW, nH; + //bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); + //while( bRegionRect ) + //{ + // if ( nW && nH ) + // { + // XRectangle aRect; + // aRect.x = (short)nX; + // aRect.y = (short)nY; + // aRect.width = (unsigned short)nW; + // aRect.height = (unsigned short)nH; + // + // XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion ); + // } + // bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); + //} + // done, invalidate GCs bPenGC_ = sal_False; bFontGC_ = sal_False; diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 0a0fe89fabad..8518ab32dcb5 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -49,7 +49,7 @@ sal_Bool GtkSalGraphics::bNeedPixmapPaint = sal_False; GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) : X11SalGraphics(), m_pWindow( pWindow ), - m_aClipRegion( REGION_NULL ) + m_aClipRegion(true) { Init( pFrame, GDK_WINDOW_XID( widget_get_window( pWindow ) ), SalX11Screen( gdk_x11_screen_get_screen_number( @@ -828,16 +828,29 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, } else { - RegionHandle aHdl = aClipRegion.BeginEnumRects(); - Rectangle aPaintRect; - while( aClipRegion.GetNextEnumRect( aHdl, aPaintRect ) ) + RectangleVector aRectangles; + aClipRegion.GetRegionRectangles(aRectangles); + + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) { - aPaintRect = aCtrlRect.GetIntersection( aPaintRect ); - if( aPaintRect.IsEmpty() ) + if(aRectIter->IsEmpty()) + { continue; - aClip.push_back( aPaintRect ); + } + + aClip.push_back(*aRectIter); } - aClipRegion.EndEnumRects( aHdl ); + + //RegionHandle aHdl = aClipRegion.BeginEnumRects(); + //Rectangle aPaintRect; + //while( aClipRegion.GetEnumRects( aHdl, aPaintRect ) ) + //{ + // aPaintRect = aCtrlRect.GetIntersection( aPaintRect ); + // if( aPaintRect.IsEmpty() ) + // continue; + // aClip.push_back( aPaintRect ); + //} + //aClipRegion.EndEnumRects( aHdl ); } if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 8b9f2d20737e..cc33f0130bed 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1450,7 +1450,8 @@ void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget) GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) : SvpSalGraphics(), mpFrame( pFrame ), - mpWindow( pWindow ) + mpWindow( pWindow ), + m_aClipRegion(true) { if(style_loaded) return; |