summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/region.cxx
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-12 15:37:11 -0500
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-13 07:54:19 +0100
commita6fee2ca4c3bd502df755be64d2b62c1a4d2c1bb (patch)
treec5d51ca450836de201ac472a89a7705480f67248 /vcl/source/gdi/region.cxx
parentc4e494bc62faa810c1b373f2e6ba7142c2b1c88d (diff)
vcl: Use scissor or stencil for clipping in OpenGL backend
Change-Id: Ib6620572391999d5f8124a1a8695909d6c48643d
Diffstat (limited to 'vcl/source/gdi/region.cxx')
-rw-r--r--vcl/source/gdi/region.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 3f56d0ef6891..6fb78b08b145 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -1434,6 +1434,23 @@ bool vcl::Region::IsOver( const Rectangle& rRect ) const
return !aRegion.IsEmpty();
}
+bool vcl::Region::IsRectangle() const
+{
+ if( IsEmpty() || IsNull() )
+ return false;
+
+ if( getB2DPolyPolygon() )
+ return basegfx::tools::isRectangle( *getB2DPolyPolygon() );
+
+ if( getPolyPolygon() )
+ return getPolyPolygon()->IsRect();
+
+ if( getRegionBand() )
+ return (getRegionBand()->getRectangleCount() == 1);
+
+ return false;
+}
+
void vcl::Region::SetNull()
{
// reset all content