[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Wed Mar 4 08:51:53 PST 2015


 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |   20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

New commits:
commit 563bfd69ba451b4db69de353c7c876483094a743
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 4 16:50:48 2015 +0000

    rely on cairo to do the clipping for us
    
    Change-Id: Ie79614027a35e09cd95ee0cb238e2e8a538a719d

diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 9f5ecf1..7c0f245 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -972,24 +972,14 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
 void GtkSalGraphics::renderAreaToPix( cairo_surface_t *source,
                                       cairo_rectangle_int_t *region)
 {
-    if( !mpFrame->m_aFrame.get() )
-        return;
-
-    long ax = region->x;
-    long ay = region->y;
-    basegfx::B2IVector size = mpFrame->m_aFrame->getSize();
-    long awidth = MIN (region->width, size.getX() - ax);
-    long aheight = MIN (region->height, size.getY() - ay);
-
     cairo_t *cr = getCairoContext();
-
-    cairo_set_source_surface( cr, source, ax, ay );
-    cairo_rectangle( cr, ax, ay, awidth, aheight );
-    cairo_fill( cr );
+    cairo_set_source_surface(cr, source, region->x, region->y);
+    cairo_rectangle(cr, region->x, region->y, region->width, region->height);
+    cairo_fill(cr);
     cairo_destroy(cr);
 
-    if ( !mpFrame->isDuringRender() )
-        gtk_widget_queue_draw_area( mpFrame->getWindow(), ax, ay, awidth, aheight );
+    if (!mpFrame->isDuringRender())
+        gtk_widget_queue_draw_area(mpFrame->getWindow(), region->x, region->y, region->width, region->height);
 }
 
 bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState,


More information about the Libreoffice-commits mailing list