summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-04 14:27:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-04 15:00:49 +0000
commita1778a4b4551102d6319a77238196a6822b84187 (patch)
tree054320fb17bf951990eb745e79129017b7a4d4c5 /vcl/unx/gtk/window
parent8a21cb8a80a1edf36644b4fd3be3220f3df48021 (diff)
seeing as we're using cairo-calls now we shouldn't need manual bounds checking
Change-Id: Id0b91600e69819bc158bda6c51d35169936299d0
Diffstat (limited to 'vcl/unx/gtk/window')
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx37
1 files changed, 3 insertions, 34 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 93cfdbb0abac..937b058c5d68 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3406,45 +3406,14 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
// we like 8byte aligned, it likes 4 - most odd.
void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
{
- if( !m_aFrame.get() )
- return;
-
- basebmp::RawMemorySharedArray data = m_aFrame->getBuffer();
- basegfx::B2IVector size = m_aFrame->getSize();
-
- long ax = area->x;
- long ay = area->y;
- long awidth = area->width;
- long aheight = area->height;
-
- // Sanity check bounds - we get some odd things here.
- if( ax >= size.getX() )
- ax = size.getX() - 1;
- if( ay >= size.getY() )
- ay = size.getY() - 1;
- if( ax < 0 )
- {
- ax = 0;
- awidth += ax;
- }
- if( ay < 0 )
- {
- ay = 0;
- aheight += ay;
- }
- if( ax + awidth > size.getX() )
- awidth = size.getX() - ax;
- if( ay + aheight > size.getY() )
- aheight = size.getY() - ay;
-
cairo_save( cr );
cairo_surface_t *pSurface = cairo_get_target(getCairoContext());
-
cairo_set_operator( cr, CAIRO_OPERATOR_OVER );
cairo_set_source_surface( cr, pSurface, 0, 0 );
- cairo_rectangle( cr, ax, ay, awidth, aheight );
+ cairo_rectangle( cr, area->x, area->y, area->width, area->height );
cairo_fill( cr );
+
cairo_restore( cr );
// Render red rectangles to show what was re-rendered ...
@@ -3453,7 +3422,7 @@ void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
cairo_save( cr );
cairo_set_line_width( cr, 1.0 );
cairo_set_source_rgb( cr, 1.0, 0, 0 );
- cairo_rectangle( cr, ax + 1.0, ay + 1.0, awidth - 2.0, aheight - 2.0 );
+ cairo_rectangle( cr, area->x + 1.0, area->y + 1.0, area->width - 2.0, area->height - 2.0 );
cairo_stroke( cr );
cairo_restore( cr );
}