summaryrefslogtreecommitdiff
path: root/cppcanvas/source/tools
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-11-02 12:42:36 +0000
committerKurt Zenker <kz@openoffice.org>2005-11-02 12:42:36 +0000
commitd81cb0595f63ab988ff19e176b5b14424a486f54 (patch)
tree5bad1d2f95182d8f15e17531dc12622f11496b8b /cppcanvas/source/tools
parent0bcb1e71def75a38d6f72d5dbd0c1d25ff828133 (diff)
INTEGRATION: CWS canvas02 (1.4.10); FILE MERGED
2005/10/09 09:16:37 thb 1.4.10.2: RESYNC: (1.4-1.5); FILE MERGED 2005/08/19 11:07:04 thb 1.4.10.1: #i53538# Changed clip setting to use basegfx polygon (cppcanvas::PolyPolygon contains reference back to canvas)
Diffstat (limited to 'cppcanvas/source/tools')
-rw-r--r--cppcanvas/source/tools/canvasgraphichelper.cxx35
1 files changed, 24 insertions, 11 deletions
diff --git a/cppcanvas/source/tools/canvasgraphichelper.cxx b/cppcanvas/source/tools/canvasgraphichelper.cxx
index c7febb4654ac..15f5b0e42d04 100644
--- a/cppcanvas/source/tools/canvasgraphichelper.cxx
+++ b/cppcanvas/source/tools/canvasgraphichelper.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: canvasgraphichelper.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 08:23:30 $
+ * last change: $Author: kz $ $Date: 2005-11-02 13:42:36 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -66,7 +66,7 @@ namespace cppcanvas
namespace internal
{
CanvasGraphicHelper::CanvasGraphicHelper( const CanvasSharedPtr& rParentCanvas ) :
- mpClipPolyPolygon(),
+ maClipPolyPolygon(),
mpCanvas( rParentCanvas ),
mxGraphicDevice()
{
@@ -95,19 +95,32 @@ namespace cppcanvas
maRenderState );
}
- void CanvasGraphicHelper::setClip( const PolyPolygonSharedPtr& rClipPoly )
+ void CanvasGraphicHelper::setClip( const ::basegfx::B2DPolyPolygon& rClipPoly )
{
- mpClipPolyPolygon = rClipPoly;
+ // TODO(T3): not thread-safe. B2DPolyPolygon employs copy-on-write
+ maClipPolyPolygon = rClipPoly;
+ maRenderState.Clip.clear();
+ }
- if( rClipPoly.get() )
- maRenderState.Clip = rClipPoly->getUNOPolyPolygon();
- else
- maRenderState.Clip.clear();
+ ::basegfx::B2DPolyPolygon CanvasGraphicHelper::getClip() const
+ {
+ return maClipPolyPolygon;
}
- PolyPolygonSharedPtr CanvasGraphicHelper::getClip() const
+ const rendering::RenderState& CanvasGraphicHelper::getRenderState() const
{
- return mpClipPolyPolygon;
+ if( maClipPolyPolygon.count() && !maRenderState.Clip.is() )
+ {
+ uno::Reference< rendering::XCanvas > xCanvas( mpCanvas->getUNOCanvas() );
+ if( !xCanvas.is() )
+ return maRenderState;
+
+ maRenderState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ xCanvas->getDevice(),
+ maClipPolyPolygon );
+ }
+
+ return maRenderState;
}
void CanvasGraphicHelper::setRGBAColor( Color::IntSRGBA aColor )