summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-04 16:50:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-04 16:50:48 +0000
commit563bfd69ba451b4db69de353c7c876483094a743 (patch)
tree2e3d5bf242cba0e3e830858ff9f30af978158ae0
parenta213af3422135a1b6feec52ee430535bb2d5d6a7 (diff)
rely on cairo to do the clipping for us
Change-Id: Ie79614027a35e09cd95ee0cb238e2e8a538a719d
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx20
1 files changed, 5 insertions, 15 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 9f5ecf191188..7c0f24583d88 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,