diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 19:56:36 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 19:56:36 +0000 |
commit | 616200da0827927b7b7bc633103295398c266402 (patch) | |
tree | 74c3d580bb1176f2f67d9669421dfc74f698044b /cppcanvas | |
parent | 3cc603d68c9ec88802a1b5fe4844f3f79e6bf2ab (diff) |
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/11/08 05:56:08 thb 1.2.2.5: #i36093# Added native canvas gradients
2004/11/01 22:21:49 thb 1.2.2.4: #110496# Performance optimizations: added profiling traces
2004/07/20 19:09:00 thb 1.2.2.3: #110496# Unified include statements; removed external prefix from boost includes
2004/05/27 20:51:28 thb 1.2.2.2: #110496#
Added classification code to all TODO/HACK/FIXME comments.
There are four categories:
- code quality (C)
- performance (P)
- missing functionality (F)
- and missing/incomplete error handling (E)
Furthermore, every category has a severity number between
1 and 3 associated, where 1 is lowest and 3 highest
severity
2004/04/05 15:58:49 thb 1.2.2.1: Resync with canvas01 changes
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/polypolyaction.cxx | 106 |
1 files changed, 79 insertions, 27 deletions
diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx index 047ef34b063c..11e4e710a394 100644 --- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx +++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx @@ -2,9 +2,9 @@ * * $RCSfile: polypolyaction.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: thb $ $Date: 2004-03-18 10:41:06 $ + * last change: $Author: rt $ $Date: 2004-11-26 20:56:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,8 +59,19 @@ * ************************************************************************/ -#include "polypolyaction.hxx" -#include "outdevstate.hxx" +#include <polypolyaction.hxx> +#include <outdevstate.hxx> + +#ifndef _RTL_LOGFILE_HXX_ +#include <rtl/logfile.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_RENDERING_XCANVAS_HPP_ +#include <drafts/com/sun/star/rendering/XCanvas.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_RENDERING_TEXTURINGMODE_HPP_ +#include <drafts/com/sun/star/rendering/TexturingMode.hpp> +#endif #ifndef _SV_GEN_HXX #include <tools/gen.hxx> @@ -76,7 +87,7 @@ #include <canvas/canvastools.hxx> #endif -#include "mtftools.hxx" +#include <mtftools.hxx> using namespace ::com::sun::star; @@ -93,6 +104,30 @@ namespace cppcanvas rPolyPoly ) ), mpCanvas( rCanvas ), maState(), + maTexture(), + maFillColor(), + maStrokeColor(), + mbFill( rState.isFillColorSet ), + mbStroke( rState.isLineColorSet ) + { + tools::initRenderState(maState,rState); + + if( mbFill ) + maFillColor = rState.fillColor; + + if( mbStroke ) + maStrokeColor = rState.lineColor; + } + + PolyPolyAction::PolyPolyAction( const ::PolyPolygon& rPolyPoly, + const CanvasSharedPtr& rCanvas, + const OutDevState& rState, + const rendering::Texture& rTexture ) : + mxPolyPoly( ::vcl::unotools::xPolyPolygonFromPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), + rPolyPoly ) ), + mpCanvas( rCanvas ), + maState(), + maTexture( rTexture ), maFillColor(), maStrokeColor(), mbFill( rState.isFillColorSet ), @@ -115,6 +150,7 @@ namespace cppcanvas rPolyPoly ) ), mpCanvas( rCanvas ), maState(), + maTexture(), maFillColor(), maStrokeColor(), mbFill( false ), @@ -134,6 +170,7 @@ namespace cppcanvas rPolyPoly ) ), mpCanvas( rCanvas ), maState(), + maTexture(), maFillColor(), maStrokeColor(), mbFill( rState.isFillColorSet ), @@ -145,7 +182,7 @@ namespace cppcanvas { maFillColor = rState.fillColor; - // TODO: Color management + // TODO(F1): Color management // adapt fill color transparency maFillColor[3] = 1.0 - nTransparency / 100.0; } @@ -154,7 +191,7 @@ namespace cppcanvas { maStrokeColor = rState.lineColor; - // TODO: Color management + // TODO(F1): Color management // adapt fill color transparency maStrokeColor[3] = 1.0 - nTransparency / 100.0; } @@ -164,30 +201,45 @@ namespace cppcanvas { } - bool PolyPolyAction::render() const + bool PolyPolyAction::render( const ::basegfx::B2DHomMatrix& rTransformation ) const { - if( mbFill ) + RTL_LOGFILE_CONTEXT( aLog, "::cppcanvas::internal::PolyPolyAction::render()" ); + RTL_LOGFILE_CONTEXT_TRACE1( aLog, "::cppcanvas::internal::PolyPolyAction: 0x%X", this ); + + rendering::RenderState aLocalState( maState ); + ::canvas::tools::prependToRenderState(aLocalState, rTransformation); + + if( maTexture.Gradient.is() ) { - // don't want to have full maState mutable, thus - // selectively casting away const here. - const_cast<PolyPolyAction*>(this)->maState.DeviceColor = maFillColor; - - // TODO: implement caching - mpCanvas->getUNOCanvas()->fillPolyPolygon( mxPolyPoly, - mpCanvas->getViewState(), - maState ); - } + uno::Sequence< rendering::Texture > aSeq(1); + aSeq[0] = maTexture; - if( mbStroke ) + mpCanvas->getUNOCanvas()->fillTexturedPolyPolygon( mxPolyPoly, + mpCanvas->getViewState(), + aLocalState, + aSeq ); + } + else { - // don't want to have full maState mutable, thus - // selectively casting away const here. - const_cast<PolyPolyAction*>(this)->maState.DeviceColor = maStrokeColor; - - // TODO: implement caching - mpCanvas->getUNOCanvas()->drawPolyPolygon( mxPolyPoly, - mpCanvas->getViewState(), - maState ); + if( mbFill ) + { + aLocalState.DeviceColor = maFillColor; + + // TODO(P1): implement caching + mpCanvas->getUNOCanvas()->fillPolyPolygon( mxPolyPoly, + mpCanvas->getViewState(), + aLocalState ); + } + + if( mbStroke ) + { + aLocalState.DeviceColor = maStrokeColor; + + // TODO(P1): implement caching + mpCanvas->getUNOCanvas()->drawPolyPolygon( mxPolyPoly, + mpCanvas->getViewState(), + aLocalState ); + } } return true; |