[Libreoffice-commits] core.git: Branch 'feature/slideshowprimitives' - 6 commits - canvas/source cppcanvas/CppunitTest_cppcanvas_test.mk cppcanvas/Library_cppcanvas.mk cppcanvas/Library_mtfrenderer.mk cppcanvas/Makefile cppcanvas/Module_cppcanvas.mk cppcanvas/qa cppcanvas/README cppcanvas/source drawinglayer/Library_drawinglayer.mk drawinglayer/source include/canvas offapi/com postprocess/Rdb_services.mk RepositoryModule_host.mk sdext/source sd/source slideshow/CppunitTest_slideshow.mk slideshow/Executable_demoshow.mk slideshow/inc slideshow/Library_slideshow.mk slideshow/source slideshow/test slideshow/TODO vcl/inc vcl/qa vcl/source
Thorsten Behrens
thb at documentfoundation.org
Sun Jan 26 15:37:56 PST 2014
Rebased ref, commits from common ancestor:
commit 2017bbdf90a22627d5d85b151795df09c5c44d16
Author: Thorsten Behrens <thb at documentfoundation.org>
Date: Sun Nov 3 21:20:00 2013 +0100
Wrap up plain XCanvas with view-specific render state.
Since XCanvas is stateless, we'd need to convey some state around,
e.g. transformations and clips. Done via struct Canvas, that we pass
on to functions, and sometimes keep as local state for stateful
objects like Views.
WIP for now.
Change-Id: I96ce2f4f1ab97c139e09938555d53f4f1edd2c02
diff --git a/slideshow/Library_slideshow.mk b/slideshow/Library_slideshow.mk
index 81b2348..d3334c8 100644
--- a/slideshow/Library_slideshow.mk
+++ b/slideshow/Library_slideshow.mk
@@ -76,6 +76,7 @@ $(eval $(call gb_Library_add_exception_objects,slideshow,\
slideshow/source/engine/animationnodes/propertyanimationnode \
slideshow/source/engine/animationnodes/sequentialtimecontainer \
slideshow/source/engine/attributemap \
+ slideshow/source/engine/canvas \
slideshow/source/engine/color \
slideshow/source/engine/delayevent \
slideshow/source/engine/effectrewinder \
diff --git a/slideshow/TODO b/slideshow/TODO
index bc1f820..c429ee4 100644
--- a/slideshow/TODO
+++ b/slideshow/TODO
@@ -1,6 +1,20 @@
Stuff left doing
================
+ - add draw/stroke/fillRectangle
+ - Canvas struct - possibly use derived SpriteCanvas, should the case
+ come up often enough (like in slideview, where we have it extra
+ currently)
+ - review drawing method input parameters - do structs make sense?
+ (uno structs are dumb, so people usually convert anyway from
+ language-specific classes, _at the callsite_)
+ candidates:
+ - X*Bitmap.idl
+ - XParametricPolyPolygon2D.idl
+ - XTextLayout.idl
+ - review geometry structs, are there any unused after the above?
+ - remove extraneous throw specs from canvas and slideshow - or does
+ that break dbgutil builds?
- grep for TODO-NYI
- migrate emf+ renderer over to primitives
- implement stateful canvas processor (e.g. for the color changes?)
@@ -8,7 +22,3 @@ Stuff left doing
- do we need viewstate at the canvas to pass around?
- how much of the wrapper state in cppcanvas _was_ actually useful?
- - review canvas api - e.g. for the createBitmap / createSprite
- methods, is anyone *not* creating a Size struct on the fly?
-
- - when all of that is done -> git rm cppcanvas
diff --git a/slideshow/source/engine/animatedsprite.cxx b/slideshow/source/engine/animatedsprite.cxx
index bb33250..74273a2 100644
--- a/slideshow/source/engine/animatedsprite.cxx
+++ b/slideshow/source/engine/animatedsprite.cxx
@@ -65,9 +65,9 @@ namespace slideshow
"AnimatedSprite::AnimatedSprite(): Could not create sprite" );
}
- uno::Reference< rendering::XCanvas > AnimatedSprite::getContentCanvas() const
+ const Canvas& AnimatedSprite::getContentCanvas() const
{
- ENSURE_OR_THROW( mpViewLayer->getCanvas().is(),
+ ENSURE_OR_THROW( mpViewLayer->getCanvas().mxCanvas.is(),
"AnimatedSprite::getContentCanvas(): No view layer canvas" );
const uno::Reference< rendering::XCanvas > pContentCanvas( mpSprite->getContentCanvas() );
@@ -88,8 +88,7 @@ namespace slideshow
// apply linear part of canvas view transformation to sprite canvas
// TODO-NYI
//pContentCanvas->setTransformation( aLinearTransform );
-
- return pContentCanvas;
+ //return pContentCanvas;
}
bool AnimatedSprite::resize( const ::basegfx::B2DSize& rSpriteSizePixel )
diff --git a/slideshow/source/engine/canvas.cxx b/slideshow/source/engine/canvas.cxx
new file mode 100644
index 0000000..213b71f
--- /dev/null
+++ b/slideshow/source/engine/canvas.cxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "canvas.hxx"
+#include <canvas/canvastools.hxx>
+
+namespace slideshow {
+namespace internal {
+
+Canvas::Canvas() :
+ mxCanvas(),
+ maViewState(),
+ maViewInfo(),
+ maDummyDefaultViewState(),
+ maDummyDefaultRenderState()
+{
+ ::canvas::tools::initViewState( maViewState );
+ ::canvas::tools::initViewState( maDummyDefaultViewState );
+ ::canvas::tools::initRenderState( maDummyDefaultRenderState );
+}
+
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index 4aa7560..4d3dea2 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -306,7 +306,7 @@ void RehearseTimingsActivity::end()
basegfx::B2DRange RehearseTimingsActivity::calcSpriteRectangle( UnoViewSharedPtr const& rView ) const
{
- const Reference<rendering::XBitmap> xBitmap( rView->getCanvas(),
+ const Reference<rendering::XBitmap> xBitmap( rView->getCanvas().mxCanvas,
UNO_QUERY );
if( !xBitmap.is() )
return basegfx::B2DRange();
diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index 8ea1d22..07bf2ea 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -299,7 +299,7 @@ namespace slideshow
// always assuming full bounds?
css::uno::Reference< css::rendering::XCanvas > pDestinationCanvas(
- maViewShapes.front()->getViewLayer()->getCanvas() );
+ maViewShapes.front()->getViewLayer()->getCanvas().mxCanvas );
#if 0
// TODO-NYI
@@ -1003,7 +1003,7 @@ namespace slideshow
// view-agnostic, it might not stay like that.
ViewShapeSharedPtr const& pViewShape = maViewShapes.front();
css::uno::Reference< css::rendering::XCanvas > const pCanvas(
- pViewShape->getViewLayer()->getCanvas() );
+ pViewShape->getViewLayer()->getCanvas().mxCanvas );
#if 0
// TODO-NYI
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index 824ae15..f24d89f 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -497,7 +497,7 @@ void ShapeImporter::importPolygons(uno::Reference<beans::XPropertySet> const& xP
{
uno::Reference< rendering::XPolyPolygon2D > xPoly=
basegfx::unotools::xPolyPolygonFromB2DPolygon(
- (*aIter)->getCanvas()->getDevice(),
+ (*aIter)->getCanvas().mxCanvas->getDevice(),
aPoly);
#if 0
// TODO-NYI
diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx
index 65165d6..0961d56 100644
--- a/slideshow/source/engine/shapes/viewappletshape.cxx
+++ b/slideshow/source/engine/shapes/viewappletshape.cxx
@@ -72,7 +72,7 @@ namespace slideshow
{
ENSURE_OR_THROW( rxShape.is(), "ViewAppletShape::ViewAppletShape(): Invalid Shape" );
ENSURE_OR_THROW( mpViewLayer, "ViewAppletShape::ViewAppletShape(): Invalid View" );
- ENSURE_OR_THROW( mpViewLayer->getCanvas().is(), "ViewAppletShape::ViewAppletShape(): Invalid ViewLayer canvas" );
+ ENSURE_OR_THROW( mpViewLayer->getCanvas().mxCanvas.is(), "ViewAppletShape::ViewAppletShape(): Invalid ViewLayer canvas" );
ENSURE_OR_THROW( mxComponentContext.is(), "ViewAppletShape::ViewAppletShape(): Invalid component context" );
uno::Reference<lang::XMultiComponentFactory> xFactory(
@@ -127,11 +127,11 @@ namespace slideshow
bool ViewAppletShape::startApplet( const ::basegfx::B2DRectangle& rBounds )
{
- ENSURE_OR_RETURN_FALSE( mpViewLayer && mpViewLayer->getCanvas().is(),
+ ENSURE_OR_RETURN_FALSE( mpViewLayer && mpViewLayer->getCanvas().mxCanvas.is(),
"ViewAppletShape::startApplet(): Invalid or disposed view" );
try
{
- css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas();
+ css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas().mxCanvas;
uno::Reference< beans::XPropertySet > xPropSet( pCanvas->getDevice(),
uno::UNO_QUERY_THROW );
@@ -231,15 +231,15 @@ namespace slideshow
bool ViewAppletShape::render( const ::basegfx::B2DRectangle& rBounds ) const
{
- css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas();
+ const Canvas& rCanvas = mpViewLayer->getCanvas();
- if( !pCanvas.is() )
+ if( !rCanvas.mxCanvas.is() )
return false;
if( !mxFrame.is() )
{
// fill the shape background with white
- fillRect( pCanvas,
+ fillRect( rCanvas,
rBounds,
basegfx::BColor(1.0) );
}
diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx
index dfa3daa..fc6400a 100644
--- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx
+++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx
@@ -141,7 +141,7 @@ namespace slideshow
{
ENSURE_OR_THROW( mpViewLayer,
"ViewBackgroundShape::ViewBackgroundShape(): Invalid View" );
- ENSURE_OR_THROW( mpViewLayer->getCanvas().is(),
+ ENSURE_OR_THROW( mpViewLayer->getCanvas().mxCanvas.is(),
"ViewBackgroundShape::ViewBackgroundShape(): Invalid ViewLayer canvas" );
}
@@ -154,7 +154,7 @@ namespace slideshow
{
SAL_INFO( "slideshow", "::presentation::internal::ViewBackgroundShape::draw()" );
- const css::uno::Reference< css::rendering::XCanvas >& rDestinationCanvas( mpViewLayer->getCanvas() );
+ const css::uno::Reference< css::rendering::XCanvas >& rDestinationCanvas( mpViewLayer->getCanvas().mxCanvas );
if( !prefetch( rDestinationCanvas, rMtf ) )
return false;
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 2e6f8bc..35eb4e6 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -79,7 +79,7 @@ namespace slideshow
{
ENSURE_OR_THROW( mxShape.is(), "ViewMediaShape::ViewMediaShape(): Invalid Shape" );
ENSURE_OR_THROW( mpViewLayer, "ViewMediaShape::ViewMediaShape(): Invalid View" );
- ENSURE_OR_THROW( mpViewLayer->getCanvas().is(), "ViewMediaShape::ViewMediaShape(): Invalid ViewLayer canvas" );
+ ENSURE_OR_THROW( mpViewLayer->getCanvas().mxCanvas.is(), "ViewMediaShape::ViewMediaShape(): Invalid ViewLayer canvas" );
ENSURE_OR_THROW( mxComponentContext.is(), "ViewMediaShape::ViewMediaShape(): Invalid component context" );
UnoViewSharedPtr pUnoView (::boost::dynamic_pointer_cast<UnoView>(rViewLayer));
@@ -177,7 +177,7 @@ namespace slideshow
bool ViewMediaShape::render( const ::basegfx::B2DRectangle& rBounds ) const
{
- css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas();
+ css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas().mxCanvas;
if( !pCanvas.is() )
return false;
@@ -220,7 +220,7 @@ namespace slideshow
{
maBounds = rNewBounds;
- css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas();
+ css::uno::Reference< css::rendering::XCanvas > pCanvas = mpViewLayer->getCanvas().mxCanvas;
if( !pCanvas.is() )
return false;
@@ -283,10 +283,10 @@ namespace slideshow
{
if( !mxPlayer.is() && mxShape.is() )
{
- ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas().is(),
+ ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas().mxCanvas.is(),
"ViewMediaShape::update(): Invalid layer canvas" );
- uno::Reference< rendering::XCanvas > xCanvas( mpViewLayer->getCanvas() );
+ uno::Reference< rendering::XCanvas > xCanvas( mpViewLayer->getCanvas().mxCanvas );
if( xCanvas.is() )
{
diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx
index e3d8579..2d92f71 100644
--- a/slideshow/source/engine/shapes/viewshape.cxx
+++ b/slideshow/source/engine/shapes/viewshape.cxx
@@ -508,7 +508,7 @@ namespace slideshow
// sprite needs repaint - output to sprite canvas
// ==============================================
- css::uno::Reference< css::rendering::XCanvas > pContentCanvas( mpSprite->getContentCanvas() );
+ css::uno::Reference< css::rendering::XCanvas > pContentCanvas( mpSprite->getContentCanvas().mxCanvas );
return draw( pContentCanvas,
xShape,
@@ -838,7 +838,7 @@ namespace slideshow
::basegfx::B2DSize ViewShape::getAntialiasingBorder() const
{
- ENSURE_OR_THROW( mpViewLayer->getCanvas().is(),
+ ENSURE_OR_THROW( mpViewLayer->getCanvas().mxCanvas.is(),
"ViewShape::getAntialiasingBorder(): Invalid ViewLayer canvas" );
#if 0
@@ -884,7 +884,7 @@ namespace slideshow
int nUpdateFlags,
bool bIsVisible ) const
{
- ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas().is(),
+ ENSURE_OR_RETURN_FALSE( mpViewLayer->getCanvas().mxCanvas.is(),
"ViewShape::update(): Invalid layer canvas" );
// Shall we render to a sprite, or to a plain canvas?
@@ -902,7 +902,7 @@ namespace slideshow
rArgs.mnShapePriority,
bIsVisible );
else
- return render( mpViewLayer->getCanvas(),
+ return render( mpViewLayer->getCanvas().mxCanvas,
xShape,
xPage,
xPrimitives,
diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx
index f6b1e4a..f4fdf98 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -608,9 +608,10 @@ namespace slideshow
return true; // visible on all views
}
- virtual css::uno::Reference< css::rendering::XCanvas > getCanvas() const
+ virtual const Canvas& getCanvas() const
{
- return mpCanvas;
+ // TODO-NYI
+ //return mpCanvas;
}
virtual void clear() const
@@ -659,6 +660,12 @@ namespace slideshow
OSL_FAIL( "BitmapView::setClip(): This method is not supposed to be called!" );
}
+ virtual basegfx::B2DPolyPolygon getClip() const
+ {
+ OSL_FAIL( "BitmapView::getClip(): This method is not supposed to be called!" );
+ return basegfx::B2DPolyPolygon();
+ }
+
virtual bool resize( const ::basegfx::B2DRange& /*rArea*/ )
{
OSL_FAIL( "BitmapView::resize(): This method is not supposed to be called!" );
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index ec3fb75..7582c9d 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -308,8 +308,8 @@ public:
// fully clear view content to background color
rView->clearAll();
- SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( rView ) );
- css::uno::Reference< css::rendering::XCanvas > pCanvas( rView->getCanvas() );
+ SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( rView ) );
+ const Canvas& rCanvas( rView->getCanvas() );
const ::basegfx::B2DHomMatrix aViewTransform( rView->getTransformation() );
const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() );
@@ -748,7 +748,7 @@ bool SlideImpl::isAnimated()
SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr& rView,
const ::basegfx::B2ISize& rBmpSize ) const
{
- ENSURE_OR_THROW( rView && rView->getCanvas().is(),
+ ENSURE_OR_THROW( rView && rView->getCanvas().mxCanvas.is(),
"SlideImpl::createCurrentSlideBitmap(): Invalid view" );
ENSURE_OR_THROW( mpLayerManager,
"SlideImpl::createCurrentSlideBitmap(): Invalid layer manager" );
@@ -756,7 +756,7 @@ SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr
"SlideImpl::createCurrentSlideBitmap(): No show loaded" );
uno::Reference< rendering::XCanvas > pCanvas(
- rView->getCanvas() );
+ rView->getCanvas().mxCanvas );
// create a bitmap of appropriate size
uno::Reference< rendering::XBitmap > pBitmap(
diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx
index 788a9bd..d19bd7a 100644
--- a/slideshow/source/engine/slide/userpaintoverlay.cxx
+++ b/slideshow/source/engine/slide/userpaintoverlay.cxx
@@ -145,7 +145,7 @@ namespace slideshow
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );
- css::uno::Reference< css::rendering::XCanvas > pCanvas( (*aIter)->getCanvas() );
+ css::uno::Reference< css::rendering::XCanvas > pCanvas( (*aIter)->getCanvas().mxCanvas );
const ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() );
const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() );
@@ -374,7 +374,7 @@ namespace slideshow
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );
- css::uno::Reference< css::rendering::XCanvas > pCanvas( (*aIter)->getCanvas() );
+ css::uno::Reference< css::rendering::XCanvas > pCanvas( (*aIter)->getCanvas().mxCanvas );
::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() );
const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() );
@@ -425,7 +425,7 @@ namespace slideshow
{
uno::Reference< rendering::XPolyPolygon2D > pPolyPoly(
basegfx::unotools::xPolyPolygonFromB2DPolygon(
- (*aIter)->getCanvas()->getDevice(),
+ (*aIter)->getCanvas().mxCanvas->getDevice(),
aPoly ) );
if( pPolyPoly.is() )
diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx
index df9a39b..f983d69 100644
--- a/slideshow/source/engine/slidebitmap.cxx
+++ b/slideshow/source/engine/slidebitmap.cxx
@@ -50,9 +50,9 @@ namespace slideshow
ENSURE_OR_THROW( mxBitmap.is(), "SlideBitmap::SlideBitmap(): Invalid bitmap" );
}
- bool SlideBitmap::draw( const css::uno::Reference< css::rendering::XCanvas >& rCanvas ) const
+ bool SlideBitmap::draw( const Canvas& rCanvas ) const
{
- ENSURE_OR_RETURN_FALSE( rCanvas.is(),
+ ENSURE_OR_RETURN_FALSE( rCanvas.mxCanvas.is(),
"SlideBitmap::draw(): Invalid canvas" );
// selectively only copy the transformation from current viewstate,
@@ -74,13 +74,13 @@ namespace slideshow
// TODO(P1): Buffer the clip polygon
aRenderState.Clip =
::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
- rCanvas->getDevice(),
+ rCanvas.mxCanvas->getDevice(),
maClipPoly );
}
- rCanvas->drawBitmap( mxBitmap,
- aViewState,
- aRenderState );
+ rCanvas.mxCanvas->drawBitmap( mxBitmap,
+ aViewState,
+ aRenderState );
}
catch( uno::Exception& )
{
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 8a6bf53..8d0a23f 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -41,15 +41,18 @@
#include <basegfx/range/b2irange.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/point/b2dpoint.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <basegfx/tools/canvastools.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <basegfx/tools/canvastools.hxx>
+#include <basegfx/color/bcolor.hxx>
#include <com/sun/star/presentation/XSlideShow.hpp>
+#include <com/sun/star/rendering/CompositeOperation.hpp>
+#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <boost/noncopyable.hpp>
#include <boost/bind.hpp>
@@ -150,61 +153,54 @@ basegfx::B2DPolyPolygon prepareClip( const basegfx::B2DPolyPolygon& rClip )
}
-void clearRect( const basegfx::B2IRange& )
+void clearRect( const ViewLayer& rViewLayer,
+ const basegfx::B2IRange& rArea,
+ const basegfx::B2DPolyPolygon* pClip=NULL )
{
-#if 0
- // TODO-NYI
- pCanvas = getCanvas(); ...
+ const Canvas& rViewCanvas = rViewLayer.getCanvas();
+
+ // set everything to default (including transformation (->device
+ // pixel))
+ rendering::ViewState aPixelViewState;
+ ::canvas::tools::initViewState( aPixelViewState );
- // convert clip polygon to device coordinate system
- ::basegfx::B2DPolyPolygon const* pClipPoly( pCanvas->getClip() );
- if( pClipPoly )
+ // convert clip polygon to device coordinate system & set to
+ // viewstate
+ if( pClip )
{
- ::basegfx::B2DPolyPolygon aClipPoly( *pClipPoly );
- aClipPoly.transform( pCanvas->getTransformation() );
- // TODO-NYI
- //pCanvas->setClip( aClipPoly );
+ ::basegfx::B2DPolyPolygon aClipPoly( *pClip );
+ aClipPoly.transform( rViewLayer.getTransformation() );
+ aPixelViewState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ rViewCanvas.mxCanvas->getDevice(),
+ aClipPoly );
}
- // set transformation to identitiy (->device pixel)
- // TODO-NYI
- //pCanvas->setTransformation( ::basegfx::B2DHomMatrix() );
+ rendering::RenderState aRenderState;
+ ::canvas::tools::initRenderState( aRenderState );
+ aRenderState.CompositeOperation = rendering::CompositeOperation::SOURCE;
+ aRenderState.DeviceColor = basegfx::BColor(0xFFFFFF00U).colorToDoubleSequence(
+ rViewCanvas.mxCanvas->getDevice());
// #i42440# Fill the _full_ background in
// black. Since we had to extend the bitmap by one
// pixel, and the bitmap is initialized white,
// depending on the slide content a one pixel wide
// line will show to the bottom and the right.
- uno::Reference<rendering::XPolyPolygon> pPolyPoly(
+ uno::Reference<rendering::XPolyPolygon2D> pPolyPoly(
basegfx::unotools::xPolyPolygonFromB2DPolygon(
- pCanvas->getDevice(),
+ rViewCanvas.mxCanvas->getDevice(),
basegfx::tools::createPolygonFromRect(
basegfx::B2DRange(rArea))) );
- if( pPolyPoly )
- {
- pPolyPoly->setCompositeOp( cppcanvas::CanvasGraphic::SOURCE );
- pPolyPoly->setRGBAFillColor( 0xFFFFFF00U );
- pPolyPoly->draw();
- }
-#endif
+ rViewCanvas.mxCanvas->fillPolyPolygon( pPolyPoly, aPixelViewState, aRenderState );
#if OSL_DEBUG_LEVEL >= 2 && defined(DBG_UTIL)
- // TODO-NYI
- uno::Reference<rendering::XCanvas> pCliplessCanvas( pCanvas->clone() );
- pCliplessCanvas->setClip();
-
- if( pCanvas->getClip() )
- {
- ::cppcanvas::PolyPolygonSharedPtr pPolyPoly2(
- ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( pCliplessCanvas,
- aPoly ));
- if( pPolyPoly2 )
- {
- pPolyPoly2->setRGBALineColor( 0x008000FFU );
- pPolyPoly2->draw();
- }
- }
+ // draw clip polygon in debug mode
+ pPolyPoly = aPixelViewState.Clip;
+ aPixelViewState.Clip.clear();
+ aRenderState.DeviceColor = basegfx::BColor(0x008000FFU).colorToDoubleSequence(
+ rViewCanvas.mxCanvas->getDevice());
+ rViewCanvas.mxCanvas->drawPolyPolygon( pPolyPoly, aPixelViewState, aRenderState );
#endif
}
@@ -393,36 +389,36 @@ class SlideViewLayer : public ViewLayer,
private boost::noncopyable
{
/// Smart container for all sprites issued by this layer
- mutable LayerSpriteContainer maSpriteContainer;
+ mutable LayerSpriteContainer maSpriteContainer;
/// Bounds of this layer in user space coordinates
- basegfx::B2DRange maLayerBounds;
+ basegfx::B2DRange maLayerBounds;
/// Bounds of this layer in device pixel
- mutable basegfx::B2IRange maLayerBoundsPixel;
+ mutable basegfx::B2IRange maLayerBoundsPixel;
/// Current clip polygon in user coordinates
- basegfx::B2DPolyPolygon maClip;
+ basegfx::B2DPolyPolygon maClip;
/// Current size of the view in user coordinates
- basegfx::B2DSize maUserSize;
+ basegfx::B2DSize maUserSize;
/// Current overall view transformation
- basegfx::B2DHomMatrix maTransformation;
+ basegfx::B2DHomMatrix maTransformation;
/// 'parent' canvas, this viewlayer is associated with
- const uno::Reference<rendering::XSpriteCanvas> mpSpriteCanvas;
+ const uno::Reference<rendering::XSpriteCanvas> mxSpriteCanvas;
/** output surface (necessarily a sprite, won't otherwise be able
to display anything <em>before</em> other sprites)
*/
- mutable uno::Reference<rendering::XCustomSprite> mpSprite;
+ mutable uno::Reference<rendering::XCustomSprite> mxSprite;
/// actual output canvas retrieved from a sprite
- mutable uno::Reference<rendering::XCanvas> mpOutputCanvas;
+ mutable Canvas maOutputCanvas;
/// ptr back to owning view. needed for isOnView() method
- View const* const mpParentView;
+ View const* const mpParentView;
public:
/** Create a new layer
@@ -436,7 +432,7 @@ public:
@param rLayerBounds
Initial layer bounds, in view coordinate system
*/
- SlideViewLayer( const uno::Reference<rendering::XSpriteCanvas>& pCanvas,
+ SlideViewLayer( const uno::Reference<rendering::XSpriteCanvas>& xCanvas,
const basegfx::B2DHomMatrix& rTransform,
const basegfx::B2DRange& rLayerBounds,
const basegfx::B2DSize& rUserSize,
@@ -447,9 +443,9 @@ public:
maClip(),
maUserSize(rUserSize),
maTransformation(rTransform),
- mpSpriteCanvas(pCanvas),
- mpSprite(),
- mpOutputCanvas(),
+ mxSpriteCanvas(xCanvas),
+ mxSprite(),
+ maOutputCanvas(),
mpParentView(pParentView)
{
}
@@ -472,8 +468,8 @@ public:
if( rNewLayerPixel != maLayerBoundsPixel )
{
// re-gen sprite with new size
- mpOutputCanvas.clear();
- mpSprite.clear();
+ maOutputCanvas.mxCanvas.clear();
+ mxSprite.clear();
}
}
@@ -503,15 +499,15 @@ private:
const ::basegfx::B2DSize& rSpriteSizePixel,
double nPriority ) const
{
- css::uno::Reference< css::rendering::XCustomSprite > pSprite(
- mpSpriteCanvas->createCustomSprite(
+ css::uno::Reference< css::rendering::XCustomSprite > xSprite(
+ mxSpriteCanvas->createCustomSprite(
rSpriteSizePixel.getX(),
rSpriteSizePixel.getY()) );
- maSpriteContainer.addSprite( pSprite,
+ maSpriteContainer.addSprite( xSprite,
nPriority );
- return pSprite;
+ return xSprite;
}
virtual void setPriority( const basegfx::B1DRange& rRange )
@@ -523,8 +519,8 @@ private:
maSpriteContainer.setLayerPriority( rRange );
- if( mpSprite.is() )
- mpSprite->setPriority( rRange.getMinimum() );
+ if( mxSprite.is() )
+ mxSprite->setPriority( rRange.getMinimum() );
}
virtual basegfx::B2DHomMatrix getTransformation() const
@@ -558,19 +554,20 @@ private:
{
// clear whole canvas
const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange());
- clearRect(basegfx::B2IRange(0,0,
- rSpriteSize.getX(),rSpriteSize.getY()));
+ basegfx::B2DPolyPolygon aClip = getClip();
+
+ clearRect(*this,
+ basegfx::B2IRange(0,0,
+ rSpriteSize.getX(),rSpriteSize.getY()),
+ &aClip);
}
virtual void clearAll() const
{
- // TODO-NYI
- // clear layer clip, to clear whole area
- //pCanvas->setClip();
-
// clear whole canvas
const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange());
- clearRect(basegfx::B2IRange(0,0,
+ clearRect(*this,
+ basegfx::B2IRange(0,0,
rSpriteSize.getX(),rSpriteSize.getY()));
}
@@ -579,11 +576,11 @@ private:
return rView.get() == mpParentView;
}
- virtual uno::Reference<rendering::XCanvas> getCanvas() const
+ virtual const Canvas& getCanvas() const
{
- if( !mpOutputCanvas.is() )
+ if( !maOutputCanvas.mxCanvas.is() )
{
- if( !mpSprite.is() )
+ if( !mxSprite.is() )
{
maLayerBoundsPixel = getLayerBoundsPixel(maLayerBounds,
maTransformation);
@@ -597,50 +594,44 @@ private:
maLayerBoundsPixel = basegfx::B2IRange(0,0,1,1);
const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange());
- mpSprite = mpSpriteCanvas->createCustomSprite(
- sal::static_int_cast<sal_Int32>(rSpriteSize.getX()),
- sal::static_int_cast<sal_Int32>(rSpriteSize.getY()) );
+ mxSprite = mxSpriteCanvas->createCustomSprite(
+ sal::static_int_cast<sal_Int32>(rSpriteSize.getX()),
+ sal::static_int_cast<sal_Int32>(rSpriteSize.getY()) );
- mpSprite->setPriority(
+ mxSprite->setPriority(
maSpriteContainer.getLayerPriority().getMinimum() );
-#if OSL_DEBUG_LEVEL >= 2 && defined(DBG_UTIL)
- mpSprite->movePixel(
- basegfx::B2DPoint(maLayerBoundsPixel.getMinimum()) +
- basegfx::B2DPoint(10,10) );
-
- mpSprite->setAlpha(0.5);
-#else
-#if 0
- // TODO-NYI
- mpSprite->movePixel(
- basegfx::B2DPoint(maLayerBoundsPixel.getMinimum()) );
-#endif
- mpSprite->setAlpha(1.0);
-#endif
- mpSprite->show();
+ mxSprite->move(
+ basegfx::unotools::point2DFromB2DPoint(
+ basegfx::B2DPoint(
+ maLayerBoundsPixel.getMinimum())),
+ maOutputCanvas.maDummyDefaultViewState,
+ maOutputCanvas.maDummyDefaultRenderState);
+ mxSprite->setAlpha(1.0);
+ mxSprite->show();
}
- ENSURE_OR_THROW( mpSprite.is(),
- "SlideViewLayer::getCanvas(): no layer sprite" );
+ ENSURE_OR_THROW( mxSprite.is(),
+ "SlideViewLayer::getCanvas(): no layer sprite" );
- mpOutputCanvas = mpSprite->getContentCanvas();
+ maOutputCanvas.mxCanvas = mxSprite->getContentCanvas();
- ENSURE_OR_THROW( mpOutputCanvas.is(),
- "SlideViewLayer::getCanvas(): sprite doesn't yield a canvas" );
+ ENSURE_OR_THROW( maOutputCanvas.mxCanvas.is(),
+ "SlideViewLayer::getCanvas(): sprite doesn't yield a canvas" );
-#if 0
- // TODO-NYI
- // new canvas retrieved - setup transformation and clip
- mpOutputCanvas->setTransformation( getTransformation() );
- mpOutputCanvas->setClip(
- createClipPolygon( maClip,
- mpOutputCanvas,
- maUserSize ));
-#endif
+ // setup clip & transform
+ ::canvas::tools::setViewStateTransform( maOutputCanvas.maViewState,
+ getTransformation() );
+ ::basegfx::B2DPolyPolygon aClipPoly =
+ createClipPolygon( maClip,
+ maUserSize );
+ maOutputCanvas.maViewState.Clip =
+ ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ maOutputCanvas.mxCanvas->getDevice(),
+ aClipPoly );
}
- return mpOutputCanvas;
+ return maOutputCanvas;
}
virtual void setClip( const basegfx::B2DPolyPolygon& rClip )
@@ -651,17 +642,24 @@ private:
{
maClip = aNewClip;
-#if 0
- // TODO-NYI
- if(mpOutputCanvas.is())
- mpOutputCanvas->setClip(
+ if( maOutputCanvas.mxCanvas.is() )
+ {
+ ::basegfx::B2DPolyPolygon aClipPoly =
createClipPolygon( maClip,
- mpOutputCanvas,
- maUserSize ));
-#endif
+ maUserSize );
+ maOutputCanvas.maViewState.Clip =
+ ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ maOutputCanvas.mxCanvas->getDevice(),
+ aClipPoly );
+ }
}
}
+ virtual basegfx::B2DPolyPolygon getClip() const
+ {
+ return maClip;
+ }
+
virtual bool resize( const ::basegfx::B2DRange& rArea )
{
const bool bRet( maLayerBounds != rArea );
@@ -707,7 +705,7 @@ private:
virtual bool isOnView(boost::shared_ptr<View> const& rView) const;
virtual void clear() const;
virtual void clearAll() const;
- virtual css::uno::Reference<rendering::XCanvas> getCanvas() const;
+ virtual const Canvas& getCanvas() const;
virtual css::uno::Reference<rendering::XCustomSprite> createSprite( const ::basegfx::B2DSize& rSpriteSizePixel,
double nPriority ) const;
virtual void setPriority( const basegfx::B1DRange& rRange );
@@ -715,6 +713,7 @@ private:
virtual ::basegfx::B2DHomMatrix getTransformation() const;
virtual basegfx::B2DHomMatrix getSpriteTransformation() const;
virtual void setClip( const ::basegfx::B2DPolyPolygon& rClip );
+ virtual basegfx::B2DPolyPolygon getClip() const;
virtual bool resize( const ::basegfx::B2DRange& rArea );
// UnoView:
@@ -750,7 +749,8 @@ private:
enum{ LAYER_ULLAGE=8 };
uno::Reference<presentation::XSlideShowView> mxView;
- uno::Reference<rendering::XSpriteCanvas> mpCanvas;
+ mutable Canvas maCanvas;
+ uno::Reference<rendering::XSpriteCanvas> mxSpriteCanvas;
EventMultiplexer& mrEventMultiplexer;
EventQueue& mrEventQueue;
@@ -771,7 +771,8 @@ SlideView::SlideView( const uno::Reference<presentation::XSlideShowView>& xView,
EventMultiplexer& rEventMultiplexer ) :
SlideViewBase( m_aMutex ),
mxView( xView ),
- mpCanvas(),
+ maCanvas(),
+ mxSpriteCanvas(),
mrEventMultiplexer( rEventMultiplexer ),
mrEventQueue( rEventQueue ),
maSprites(),
@@ -786,9 +787,12 @@ SlideView::SlideView( const uno::Reference<presentation::XSlideShowView>& xView,
ENSURE_OR_THROW( mxView.is(),
"SlideView::SlideView(): Invalid view" );
- mpCanvas = xView->getCanvas();
- ENSURE_OR_THROW( mpCanvas.is(),
- "Could not obtain Canvas" );
+ maCanvas.mxCanvas = xView->getCanvas();
+ mxSpriteCanvas.set( maCanvas.mxCanvas,
+ uno::UNO_QUERY );
+
+ ENSURE_OR_THROW( maCanvas.mxCanvas.is() && mxSpriteCanvas.is(),
+ "Could not obtain XSpriteCanvas" );
geometry::AffineMatrix2D aViewTransform(
xView->getTransformation() );
@@ -819,7 +823,8 @@ void SlideView::disposing()
maViewLayers.clear();
maSprites.clear();
- mpCanvas.clear();
+ maCanvas.mxCanvas.clear();
+ mxSpriteCanvas.clear();
// additionally, also de-register from XSlideShowView
if (mxView.is())
@@ -834,7 +839,7 @@ ViewLayerSharedPtr SlideView::createViewLayer( const basegfx::B2DRange& rLayerBo
{
osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_THROW( mpCanvas.is(),
+ ENSURE_OR_THROW( maCanvas.mxCanvas.is(),
"SlideView::createViewLayer(): Disposed" );
const std::size_t nNumLayers( maViewLayers.size() );
@@ -844,11 +849,12 @@ ViewLayerSharedPtr SlideView::createViewLayer( const basegfx::B2DRange& rLayerBo
if( nNumLayers > LAYER_ULLAGE )
pruneLayers();
- boost::shared_ptr<SlideViewLayer> pViewLayer( new SlideViewLayer(mpCanvas,
- getTransformation(),
- rLayerBounds,
- maUserSize,
- this) );
+ boost::shared_ptr<SlideViewLayer> pViewLayer(
+ new SlideViewLayer(mxSpriteCanvas,
+ getTransformation(),
+ rLayerBounds,
+ maUserSize,
+ this) );
maViewLayers.push_back( pViewLayer );
return pViewLayer;
@@ -858,52 +864,53 @@ bool SlideView::updateScreen() const
{
osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_RETURN_FALSE( mpCanvas.get(),
+ ENSURE_OR_RETURN_FALSE( maCanvas.mxCanvas.is(),
"SlideView::updateScreen(): Disposed" );
- return mpCanvas->updateScreen( false );
+ return mxSpriteCanvas->updateScreen( false );
}
bool SlideView::paintScreen() const
{
osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_RETURN_FALSE( mpCanvas.get(),
+ ENSURE_OR_RETURN_FALSE( maCanvas.mxCanvas.is(),
"SlideView::paintScreen(): Disposed" );
- return mpCanvas->updateScreen( true );
+ return mxSpriteCanvas->updateScreen( true );
}
void SlideView::clear() const
{
osl::MutexGuard aGuard( m_aMutex );
- OSL_ENSURE( mxView.is() && mpCanvas.is(),
+ OSL_ENSURE( mxView.is() && maCanvas.mxCanvas.is(),
"SlideView::clear(): Disposed" );
- if( !mxView.is() || !mpCanvas.is() )
+ if( !mxView.is() || !maCanvas.mxCanvas.is() )
return;
// keep layer clip
- clearRect(getLayerBoundsPixel(
- basegfx::B2DRange(0,0,
- maUserSize.getX(),
- maUserSize.getY()),
- getTransformation()));
+ clearRect( *this,
+ getLayerBoundsPixel(
+ basegfx::B2DRange(0,0,
+ maUserSize.getX(),
+ maUserSize.getY()),
+ getTransformation()));
}
void SlideView::clearAll() const
{
osl::MutexGuard aGuard( m_aMutex );
- OSL_ENSURE( mxView.is() && mpCanvas.is(),
+ OSL_ENSURE( mxView.is() && maCanvas.mxCanvas.is(),
"SlideView::clear(): Disposed" );
- if( !mxView.is() || !mpCanvas.is() )
+ if( !mxView.is() || !maCanvas.mxCanvas.is() )
return;
- mpCanvas->erase(); // this is unnecessary, strictly speaking. but
- // it makes the SlideView behave exactly like a
- // sprite-based SlideViewLayer, because those
- // are created from scratch after a resize
+ maCanvas.mxCanvas->erase(); // this is unnecessary, strictly speaking. but
+ // it makes the SlideView behave exactly like a
+ // sprite-based SlideViewLayer, because those
+ // are created from scratch after a resize
// clear whole view
mxView->clear();
@@ -930,14 +937,14 @@ bool SlideView::isOnView(boost::shared_ptr<View> const& rView) const
return rView.get() == this;
}
-css::uno::Reference< css::rendering::XCanvas > SlideView::getCanvas() const
+const Canvas& SlideView::getCanvas() const
{
osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_THROW( mpCanvas.is(),
+ ENSURE_OR_THROW( maCanvas.mxCanvas.is(),
"SlideView::getCanvas(): Disposed" );
- return mpCanvas;
+ return maCanvas;
}
css::uno::Reference< css::rendering::XCustomSprite > SlideView::createSprite(
@@ -946,10 +953,10 @@ css::uno::Reference< css::rendering::XCustomSprite > SlideView::createSprite(
{
osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_THROW( mpCanvas.is(), "SlideView::createSprite(): Disposed" );
+ ENSURE_OR_THROW( maCanvas.mxCanvas.is(), "SlideView::createSprite(): Disposed" );
css::uno::Reference< css::rendering::XCustomSprite > pSprite(
- mpCanvas->createCustomSprite(
+ mxSpriteCanvas->createCustomSprite(
rSpriteSizePixel.getX(),
rSpriteSizePixel.getY()) );
@@ -964,7 +971,7 @@ void SlideView::setPriority( const basegfx::B1DRange& /*rRange*/ )
osl::MutexGuard aGuard( m_aMutex );
OSL_FAIL( "SlideView::setPriority() is a NOOP for slide view - "
- "content will always be shown in the background" );
+ "content will always be shown in the background" );
}
basegfx::B2DHomMatrix SlideView::getTransformation() const
@@ -1001,6 +1008,13 @@ void SlideView::setClip( const basegfx::B2DPolyPolygon& rClip )
}
}
+basegfx::B2DPolyPolygon SlideView::getClip() const
+{
+ osl::MutexGuard aGuard( m_aMutex );
+
+ return maClip;
+}
+
bool SlideView::resize( const ::basegfx::B2DRange& /*rArea*/ )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -1106,7 +1120,7 @@ void SlideView::windowPaint( const awt::PaintEvent& /*e*/ )
{
osl::MutexGuard aGuard( m_aMutex );
- OSL_ENSURE( mxView.is() && mpCanvas.is(), "Disposed, but event received?!" );
+ OSL_ENSURE( mxView.is() && maCanvas.mxCanvas.is(), "Disposed, but event received?!" );
// notify view clobbering. Don't call EventMultiplexer directly,
// this might not be the main thread!
@@ -1118,20 +1132,24 @@ void SlideView::windowPaint( const awt::PaintEvent& /*e*/ )
void SlideView::updateCanvas()
{
- OSL_ENSURE( mpCanvas.is(),
+ OSL_ENSURE( maCanvas.mxCanvas.is(),
"SlideView::updateCanvasTransform(): Disposed" );
- if( !mpCanvas.is() || !mxView.is())
+ if( !maCanvas.mxCanvas.is() || !mxView.is())
return;
clearAll();
-#if 0
- // TODO-NYI
- mpCanvas->setTransformation( getTransformation() );
- mpCanvas->setClip(
- createClipPolygon( maClip,
- maUserSize ));
-#endif
+
+ ::canvas::tools::setViewStateTransform(
+ maCanvas.maViewState,
+ getTransformation() );
+ ::basegfx::B2DPolyPolygon aClipPoly =
+ createClipPolygon( maClip,
+ maUserSize );
+ maCanvas.maViewState.Clip =
+ ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ maCanvas.mxCanvas->getDevice(),
+ aClipPoly );
// forward update to viewlayers
pruneLayers( true );
@@ -1140,18 +1158,20 @@ void SlideView::updateCanvas()
void SlideView::updateClip()
{
// TODO-NYI - here and other places, consolidate to ensure_and_return!
- OSL_ENSURE( mpCanvas.is(),
+ OSL_ENSURE( maCanvas.mxCanvas.is(),
"SlideView::updateClip(): Disposed" );
- if( !mpCanvas.is() )
+ if( !maCanvas.mxCanvas.is() )
return;
-#if 0
- // TODO-NYI
- mpCanvas->setClip(
- createClipPolygon( maClip,
- maUserSize ));
-#endif
+ ::basegfx::B2DPolyPolygon aClipPoly =
+ createClipPolygon( maClip,
+ maUserSize );
+ maCanvas.maViewState.Clip =
+ ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
+ maCanvas.mxCanvas->getDevice(),
+ aClipPoly );
+
pruneLayers( false );
}
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index 59865ab..120d13e 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -669,23 +669,22 @@ namespace slideshow
static_cast< sal_uInt8 >( nColor ) / 255.0 );
}
- void fillRect( const uno::Reference< rendering::XCanvas >& xCanvas,
- const ::basegfx::B2DRectangle& rRect,
- const basegfx::BColor& rFillColor )
+ void fillRect( const Canvas& rCanvas,
+ const ::basegfx::B2DRectangle& rRect,
+ const basegfx::BColor& rFillColor )
{
// TODO-NYI
- rendering::ViewState aViewState;
rendering::RenderState aRenderState;
canvas::tools::initRenderState(aRenderState);
aRenderState.DeviceColor =
rFillColor.colorToDoubleSequence(
- xCanvas->getDevice());
+ rCanvas.mxCanvas->getDevice());
- xCanvas->fillPolyPolygon(
+ rCanvas.mxCanvas->fillPolyPolygon(
basegfx::unotools::xPolyPolygonFromB2DPolygon(
- xCanvas->getDevice(),
+ rCanvas.mxCanvas->getDevice(),
::basegfx::tools::createPolygonFromRect( rRect )),
- aViewState, aRenderState);
+ rCanvas.maViewState, aRenderState);
}
::basegfx::B2DRectangle getAPIShapeBounds( const uno::Reference< drawing::XShape >& xShape )
diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx
index 94f920b..f80a194 100644
--- a/slideshow/source/engine/transitions/combtransition.cxx
+++ b/slideshow/source/engine/transitions/combtransition.cxx
@@ -92,7 +92,7 @@ void CombTransition::renderComb( double ,
const ViewEntry& rViewEntry ) const
{
const SlideBitmapSharedPtr& pEnteringBitmap = getEnteringBitmap(rViewEntry);
- const uno::Reference<rendering::XCanvas> pCanvas = rViewEntry.mpView->getCanvas();
+ const uno::Reference<rendering::XCanvas> pCanvas = rViewEntry.mpView->getCanvas().mxCanvas;
if( !pEnteringBitmap || !pCanvas.is() )
return;
diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx
index d33da9c..38aaed3 100644
--- a/slideshow/source/engine/transitions/slidechangebase.cxx
+++ b/slideshow/source/engine/transitions/slidechangebase.cxx
@@ -102,7 +102,7 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr&
getSlideSizePixel( basegfx::B2DSize( mpEnteringSlide->getSlideSize() ),
rView ));
- uno::Reference<rendering::XCanvas> pCanvas( rView->getCanvas() );
+ uno::Reference<rendering::XCanvas> pCanvas( rView->getCanvas().mxCanvas );
// create a bitmap of appropriate size
uno::Reference<rendering::XBitmap> pBitmap(
@@ -200,7 +200,7 @@ void SlideChangeBase::start( const AnimatableShapeSharedPtr& rShape,
// get the subclasses a chance to do any specific initialization before run
for ( ViewsVecT::const_iterator aCurr( beginViews() ), aEnd( endViews() ); aCurr != aEnd; ++aCurr )
- prepareForRun( *aCurr, aCurr->mpView->getCanvas() );
+ prepareForRun( *aCurr, aCurr->mpView->getCanvas().mxCanvas );
// start accompanying sound effect, if any
if( mpSoundPlayer )
@@ -232,7 +232,7 @@ void SlideChangeBase::end()
pSlideBitmap->clip( basegfx::B2DPolyPolygon() /* no clipping */ );
aCurr->mpView->clearAll();
renderBitmap( pSlideBitmap,
- aCurr->mpView->getCanvas() );
+ aCurr->mpView->getCanvas().mxCanvas );
++aCurr;
}
@@ -277,7 +277,7 @@ bool SlideChangeBase::operator()( double nValue )
// (i.e. pixel).
ViewEntry& rViewEntry( maViewData[i] );
- const uno::Reference<rendering::XCanvas>& rCanvas( rViewEntry.mpView->getCanvas() );
+ const uno::Reference<rendering::XCanvas>& rCanvas( rViewEntry.mpView->getCanvas().mxCanvas );
uno::Reference<rendering::XCustomSprite>& rInSprite( rViewEntry.mpInSprite );
uno::Reference<rendering::XCustomSprite>& rOutSprite( rViewEntry.mpOutSprite );
@@ -316,8 +316,9 @@ bool SlideChangeBase::operator()( double nValue )
// render the content
OSL_ASSERT( getLeavingBitmap( rViewEntry ) );
- if( getLeavingBitmap( rViewEntry ) )
- getLeavingBitmap( rViewEntry )->draw( pOutContentCanvas );
+ // TODO-NYI
+ //if( getLeavingBitmap( rViewEntry ) )
+ //getLeavingBitmap( rViewEntry )->draw( pOutContentCanvas );
}
}
@@ -335,7 +336,8 @@ bool SlideChangeBase::operator()( double nValue )
// between different canvases!
// render the content
- getEnteringBitmap( rViewEntry )->draw( pInContentCanvas );
+ // TODO-NYI
+ //getEnteringBitmap( rViewEntry )->draw( pInContentCanvas );
}
}
}
diff --git a/slideshow/source/inc/animatedsprite.hxx b/slideshow/source/inc/animatedsprite.hxx
index 8be16d0..5c0cb1e 100644
--- a/slideshow/source/inc/animatedsprite.hxx
+++ b/slideshow/source/inc/animatedsprite.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SLIDESHOW_ANIMATEDSPRITE_HXX
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XCustomSprite.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -29,6 +28,7 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include "canvas.hxx"
#include "viewlayer.hxx"
#include <boost/optional.hpp>
@@ -106,7 +106,7 @@ namespace slideshow
canvas is already correctly setup, matching the
associated destination canvas.
*/
- css::uno::Reference< css::rendering::XCanvas > getContentCanvas() const;
+ const Canvas& getContentCanvas() const;
/** Move the sprite in device pixel space.
diff --git a/slideshow/source/inc/canvas.hxx b/slideshow/source/inc/canvas.hxx
new file mode 100644
index 0000000..e7f396f
--- /dev/null
+++ b/slideshow/source/inc/canvas.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SLIDESHOW_CANVAS_HXX
+#define INCLUDED_SLIDESHOW_CANVAS_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/ViewState.hpp>
+#include <com/sun/star/rendering/RenderState.hpp>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+namespace slideshow
+{
+ namespace internal
+ {
+ /// XCanvas and state parameters to render stuff
+ struct Canvas
+ {
+ Canvas();
+
+ /// render target
+ css::uno::Reference< css::rendering::XCanvas > mxCanvas;
+ /// view setup, clip etc
+ css::rendering::ViewState maViewState;
+ /// drawing layer view setup
+ ::drawinglayer::geometry::ViewInformation2D maViewInfo;
+
+ /// default-state view, for output into raw device state
+ css::rendering::ViewState maDummyDefaultViewState;
+ /// default-state render, for output into raw device state
+ css::rendering::RenderState maDummyDefaultRenderState;
+ };
+ }
+}
+
+#endif /* INCLUDED_SLIDESHOW_CANVAS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/inc/slidebitmap.hxx b/slideshow/source/inc/slidebitmap.hxx
index 2856fd8..f0fd9b3 100644
--- a/slideshow/source/inc/slidebitmap.hxx
+++ b/slideshow/source/inc/slidebitmap.hxx
@@ -21,13 +21,14 @@
#define INCLUDED_SLIDESHOW_SLIDEBITMAP_HXX
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XBitmap.hpp>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include "canvas.hxx"
+
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
@@ -63,7 +64,7 @@ namespace slideshow
public:
SlideBitmap( const css::uno::Reference< css::rendering::XBitmap >& rBitmap );
- bool draw( const css::uno::Reference< css::rendering::XCanvas >& rCanvas ) const;
+ bool draw( const Canvas& rCanvas ) const;
::basegfx::B2ISize getSize() const;
::basegfx::B2DPoint getOutputPos() const{return maOutputPos;}
void move( const ::basegfx::B2DPoint& rNewPos );
diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx
index c2053e0..7caf742 100644
--- a/slideshow/source/inc/tools.hxx
+++ b/slideshow/source/inc/tools.hxx
@@ -27,6 +27,7 @@
#include <basegfx/color/bcolor.hxx>
+#include "canvas.hxx"
#include "shapeattributelayer.hxx"
#include "shape.hxx"
#include "rgbcolor.hxx"
@@ -274,9 +275,9 @@ namespace slideshow
/** Fill a plain rectangle on the given canvas with the given color
*/
- void fillRect( const css::uno::Reference< css::rendering::XCanvas >& rCanvas,
- const basegfx::B2DRange& rRect,
- const basegfx::BColor& rFillColor );
+ void fillRect( const Canvas& rCanvas,
+ const basegfx::B2DRange& rRect,
+ const basegfx::BColor& rFillColor );
/// Gets a random ordinal [0,n)
inline ::std::size_t getRandomOrdinal( const ::std::size_t n )
diff --git a/slideshow/source/inc/viewlayer.hxx b/slideshow/source/inc/viewlayer.hxx
index b412965..31435a8 100644
--- a/slideshow/source/inc/viewlayer.hxx
+++ b/slideshow/source/inc/viewlayer.hxx
@@ -24,9 +24,10 @@
#include <boost/shared_ptr.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/geometry/IntegerSize2D.hpp>
-#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XCustomSprite.hpp>
+#include "canvas.hxx"
+
namespace basegfx
{
class B1DRange;
@@ -45,6 +46,14 @@ namespace slideshow
{
class View;
+ /** One layer in a View
+
+ One out of possibly many layers in one View (in the MVC
+ sense of view) of the slideshow. We use ViewLayers to
+ group shapes with similar animation state, such that
+ animated effects display at the right 'z' order (i.e. in
+ front or behind other shapes).
+ */
class ViewLayer
{
public:
@@ -62,7 +71,7 @@ namespace slideshow
The canvas returned by this method must not change, as
long as this object is alive.
*/
- virtual css::uno::Reference< css::rendering::XCanvas > getCanvas() const = 0;
+ virtual const Canvas& getCanvas() const = 0;
/** Clear the clipped view layer area
@@ -98,8 +107,8 @@ namespace slideshow
canvas does not support sprites).
*/
virtual css::uno::Reference< css::rendering::XCustomSprite >
- createSprite( const basegfx::B2DVector& rSpriteSizePixel,
- double nPriority ) const = 0;
+ createSprite( const basegfx::B2DVector& rSpriteSizePixel,
+ double nPriority ) const = 0;
/** Set the layer priority range
@@ -147,6 +156,16 @@ namespace slideshow
*/
virtual void setClip( const basegfx::B2DPolyPolygon& rClip ) = 0;
+ /** Get clipping of this view layer.
+
+ @return
+ Clip poly-polygon of this layer. The polygon is interpreted
+ in the user coordinate system, i.e. the view layer has
+ the size as given by setViewSize() on its
+ corresponding View.
+ */
+ virtual basegfx::B2DPolyPolygon getClip() const = 0;
+
/** Resize this view layer.
@param rArea
commit 9fa9ea0423d97c39293b1788940bda93dbf99ec9
Author: Thorsten Behrens <thb at documentfoundation.org>
Date: Sun Jan 26 16:40:30 2014 +0100
Remove inline SCM comments and unused parameters.
Change-Id: I5c123a924697c14f3c2a44b357ef4bd22ce7a51d
diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx
index 8f44305..185b54e 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -232,11 +232,6 @@ namespace slideshow
"PathAnimation::PathAnimation(): failed to parse SVG:d path" );
ENSURE_OR_THROW( aPolyPoly.count() == 1,
"PathAnimation::PathAnimation(): motion path consists of multiple/zero polygon(s)" );
-
- // TODO(F2): Since getPositionRelative() currently
- // cannot handle beziers, have to subdivide.
- // AW: Should be no longer necessary; getPositionRelative is now bezier-safe
- maPathPoly = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPoly.getB2DPolygon(0) );
}
~PathAnimation()
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 0a00611..8a6bf53 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -115,24 +115,17 @@ typedef std::vector< SpriteEntry > SpriteVector;
@return the view clip polygon, in view coordinates, which is
guaranteed to at least clip to the view size.
*/
-basegfx::B2DPolyPolygon createClipPolygon( const basegfx::B2DPolyPolygon& rClip,
- const uno::Reference<rendering::XCanvas>& /*rCanvas*/,
- const basegfx::B2DSize& rUserSize )
+basegfx::B2DPolyPolygon createClipPolygon( const basegfx::B2DPolyPolygon& rClip,
+ const basegfx::B2DSize& rUserSize )
{
// setup canvas clipping
// =====================
- // AW: Simplified
const basegfx::B2DRange aClipRange(0, 0, rUserSize.getX(), rUserSize.getY());
-
if(rClip.count())
- {
return basegfx::tools::clipPolyPolygonOnRange(rClip, aClipRange, true, false);
- }
else
- {
return basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aClipRange));
- }
}
/** Prepare given clip polygon to be stored as the current clip
@@ -146,11 +139,6 @@ basegfx::B2DPolyPolygon prepareClip( const basegfx::B2DPolyPolygon& rClip )
{
basegfx::B2DPolyPolygon aClip( rClip );
- // TODO(P2): unnecessary, once XCanvas is correctly handling this
- // AW: Should be no longer necessary; tools are now bezier-safe
- if( aClip.areControlPointsUsed() )
- aClip = basegfx::tools::adaptiveSubdivideByAngle( aClip );
-
// normalize polygon, preparation for clipping
// in updateCanvas()
aClip = basegfx::tools::correctOrientations(aClip);
@@ -1142,7 +1130,6 @@ void SlideView::updateCanvas()
mpCanvas->setTransformation( getTransformation() );
mpCanvas->setClip(
createClipPolygon( maClip,
- mpCanvas,
maUserSize ));
#endif
@@ -1163,7 +1150,6 @@ void SlideView::updateClip()
// TODO-NYI
mpCanvas->setClip(
createClipPolygon( maClip,
- mpCanvas,
maUserSize ));
#endif
pruneLayers( false );
diff --git a/slideshow/source/engine/transitions/clippingfunctor.cxx b/slideshow/source/engine/transitions/clippingfunctor.cxx
index a8c912f..b6ed4e8 100644
--- a/slideshow/source/engine/transitions/clippingfunctor.cxx
+++ b/slideshow/source/engine/transitions/clippingfunctor.cxx
@@ -53,13 +53,6 @@ namespace slideshow
// poly-polygon with the minuent - i.e. choose the
// polygon to subtract from sufficiently large.
- // blow up unit rect to (-1,-1),(2,2)
- // AW: Not needed, just use range
- // ::basegfx::B2DHomMatrix aMatrix;
- // aMatrix.scale(3.0,3.0);
- // aMatrix.translate(-1.0,-1.0);
- // maBackgroundRect.transform( aMatrix );
-
// extract modification info from maTransitionInfo
// -----------------------------------------------
@@ -175,7 +168,6 @@ namespace slideshow
// calc maBackgroundRect \ aClipPoly
// =================================
- // AW: Simplified
// use a range with fixed size (-1,-1),(2,2)
const basegfx::B2DRange aBackgroundRange(-1, -1, 2, 2);
const basegfx::B2DRange aClipPolyRange(aClipPoly.getB2DRange());
diff --git a/slideshow/source/engine/transitions/clippingfunctor.hxx b/slideshow/source/engine/transitions/clippingfunctor.hxx
index ceba88a..01c6e99 100644
--- a/slideshow/source/engine/transitions/clippingfunctor.hxx
+++ b/slideshow/source/engine/transitions/clippingfunctor.hxx
@@ -73,8 +73,6 @@ namespace slideshow
private:
ParametricPolyPolygonSharedPtr mpParametricPoly;
::basegfx::B2DHomMatrix maStaticTransformation;
- // AW: Not needed
- // ::basegfx::B2DPolyPolygon maBackgroundRect;
bool mbForwardParameterSweep;
bool mbSubtractPolygon;
const bool mbScaleIsotrophically;
commit 6b1231f2d7ed368204c3c67f530578505f238264
Author: Thorsten Behrens <thb at documentfoundation.org>
Date: Fri Nov 1 00:55:26 2013 +0100
[API CHANGE] Avoid excessive compound struct use for XCanvas.
Avoid excessive use of compound structures like integer or real
number sizes for bitmap or sprite creation. Everyone has to convert
into temporary UNO API compound structs at call sites otherwise,
let's skip that waste.
Change-Id: Ia242175334a48deabaf081675306377c1ba4322c
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx
index 171336f..05d15b5 100644
--- a/canvas/source/cairo/cairo_canvascustomsprite.cxx
+++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx
@@ -37,16 +37,17 @@ using namespace ::com::sun::star;
namespace cairocanvas
{
- CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rRefDevice ) :
+ CanvasCustomSprite::CanvasCustomSprite( double width,
+ double height,
+ const SpriteCanvasRef& rRefDevice ) :
mpSpriteCanvas( rRefDevice ),
- maSize( ::canvas::tools::roundUp( rSpriteSize.Width ),
- ::canvas::tools::roundUp( rSpriteSize.Height ) )
+ maSize( ::canvas::tools::roundUp( width ),
+ ::canvas::tools::roundUp( height ) )
{
ENSURE_OR_THROW( rRefDevice.get(),
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
- SAL_INFO( "canvas.cairo", "sprite size: " << ::canvas::tools::roundUp( rSpriteSize.Width ) << ", " << ::canvas::tools::roundUp( rSpriteSize.Height ));
+ SAL_INFO( "canvas.cairo", "sprite size: " << ::canvas::tools::roundUp( width ) << ", " << ::canvas::tools::roundUp( height ));
mpBufferSurface = mpSpriteCanvas->createSurface( maSize );
@@ -55,7 +56,7 @@ namespace cairocanvas
rRefDevice.get() );
maCanvasHelper.setSurface( mpBufferSurface, true );
- maSpriteHelper.init( rSpriteSize,
+ maSpriteHelper.init( width, height,
rRefDevice );
maSpriteHelper.setSurface( mpBufferSurface );
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.hxx b/canvas/source/cairo/cairo_canvascustomsprite.hxx
index cfb6377..5a5c2b7 100644
--- a/canvas/source/cairo/cairo_canvascustomsprite.hxx
+++ b/canvas/source/cairo/cairo_canvascustomsprite.hxx
@@ -87,7 +87,10 @@ namespace cairocanvas
public:
/** Create a custom sprite
- @param rSpriteSize
+ @param width
+ Size of the sprite in pixel
+
+ @param height
Size of the sprite in pixel
@param rRefDevice
@@ -99,8 +102,9 @@ namespace cairocanvas
@param rDevice
Target DX device
*/
- CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rRefDevice );
+ CanvasCustomSprite( double width,
+ double height,
+ const SpriteCanvasRef& rRefDevice );
virtual void disposeThis();
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 28eb92e..57345fc 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1562,8 +1562,9 @@ namespace cairocanvas
return ::basegfx::unotools::integerSize2DFromB2ISize( maSize );
}
- uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize,
- sal_Bool /*beFast*/ )
+ uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( double width,
+ double height,
+ sal_Bool /*beFast*/ )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
@@ -1572,9 +1573,11 @@ namespace cairocanvas
if( mpCairo )
{
- return uno::Reference< rendering::XBitmap >( new CanvasBitmap( ::basegfx::B2ISize( ::canvas::tools::roundUp( newSize.Width ),
- ::canvas::tools::roundUp( newSize.Height ) ),
- mpSurfaceProvider, mpDevice, false ) );
+ return uno::Reference< rendering::XBitmap >(
+ new CanvasBitmap(
+ ::basegfx::B2ISize( ::canvas::tools::roundUp( width ),
+ ::canvas::tools::roundUp( height ) ),
+ mpSurfaceProvider, mpDevice, false ) );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx
index c90e79a..31fab24 100644
--- a/canvas/source/cairo/cairo_canvashelper.hxx
+++ b/canvas/source/cairo/cairo_canvashelper.hxx
@@ -231,8 +231,9 @@ namespace cairocanvas
::com::sun::star::geometry::IntegerSize2D getSize();
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
- getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize,
- sal_Bool beFast );
+ getScaledBitmap( double width,
+ double height,
+ sal_Bool beFast );
::com::sun::star::uno::Sequence< sal_Int8 >
getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx
index 3973836..89bbb094 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -158,7 +158,7 @@ namespace cairocanvas
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap(
const uno::Reference< rendering::XGraphicDevice >& rDevice,
- const geometry::IntegerSize2D& size )
+ sal_Int32 width, sal_Int32 height )
{
// disposed?
if( !mpSurfaceProvider )
@@ -166,7 +166,7 @@ namespace cairocanvas
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap(
- ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ),
+ ::basegfx::B2ISize( width, height ),
SurfaceProviderRef(mpSurfaceProvider),
rDevice.get(),
false ));
@@ -174,14 +174,14 @@ namespace cairocanvas
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap(
const uno::Reference< rendering::XGraphicDevice >& ,
- const geometry::IntegerSize2D& /*size*/ )
+ sal_Int32, sal_Int32 )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& rDevice,
- const geometry::IntegerSize2D& size )
+ sal_Int32 width, sal_Int32 height )
{
// disposed?
if( !mpSurfaceProvider )
@@ -189,7 +189,7 @@ namespace cairocanvas
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap(
- ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ),
+ ::basegfx::B2ISize( width, height ),
SurfaceProviderRef(mpSurfaceProvider),
rDevice.get(),
true ));
@@ -197,7 +197,7 @@ namespace cairocanvas
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& ,
- const geometry::IntegerSize2D& /*size*/ )
+ sal_Int32, sal_Int32 )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
diff --git a/canvas/source/cairo/cairo_devicehelper.hxx b/canvas/source/cairo/cairo_devicehelper.hxx
index fec36e5..50643b2 100644
--- a/canvas/source/cairo/cairo_devicehelper.hxx
+++ b/canvas/source/cairo/cairo_devicehelper.hxx
@@ -67,16 +67,16 @@ namespace cairocanvas
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
sal_Bool hasFullScreenMode( );
sal_Bool enterFullScreenMode( sal_Bool bEnter );
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index bf30993..615b440 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -173,13 +173,13 @@ namespace cairocanvas
return uno::Reference< rendering::XAnimatedSprite >();
}
- uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( const geometry::RealSize2D& spriteSize )
+ uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( double width, double height )
{
if( !mpRedrawManager )
return uno::Reference< rendering::XCustomSprite >(); // we're disposed
return uno::Reference< rendering::XCustomSprite >(
- new CanvasCustomSprite( spriteSize,
+ new CanvasCustomSprite( width, height,
mpOwningSpriteCanvas ) );
}
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.hxx b/canvas/source/cairo/cairo_spritecanvashelper.hxx
index 07c3aa8..63cb3f9 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.hxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.hxx
@@ -63,7 +63,7 @@ namespace cairocanvas
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCustomSprite > createCustomSprite(
- const ::com::sun::star::geometry::RealSize2D& spriteSize );
+ double width, double height );
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSprite > createClonedSprite(
diff --git a/canvas/source/cairo/cairo_spritehelper.cxx b/canvas/source/cairo/cairo_spritehelper.cxx
index 7992deb..be5e96e 100644
--- a/canvas/source/cairo/cairo_spritehelper.cxx
+++ b/canvas/source/cairo/cairo_spritehelper.cxx
@@ -51,8 +51,9 @@ namespace cairocanvas
mbTextureDirty(true)
{}
- void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rSpriteCanvas )
+ void SpriteHelper::init( double width,
+ double height,
+ const SpriteCanvasRef& rSpriteCanvas )
{
ENSURE_OR_THROW( rSpriteCanvas.get(),
"SpriteHelper::init(): Invalid device, sprite canvas or surface" );
@@ -61,7 +62,7 @@ namespace cairocanvas
mbTextureDirty = true;
// also init base class
- CanvasCustomSpriteHelper::init( rSpriteSize,
+ CanvasCustomSpriteHelper::init( width, height,
rSpriteCanvas.get() );
}
diff --git a/canvas/source/cairo/cairo_spritehelper.hxx b/canvas/source/cairo/cairo_spritehelper.hxx
index 69385e5..e59e6d0 100644
--- a/canvas/source/cairo/cairo_spritehelper.hxx
+++ b/canvas/source/cairo/cairo_spritehelper.hxx
@@ -49,7 +49,10 @@ namespace cairocanvas
/** Late-init the sprite helper
- @param rSpriteSize
+ @param width
+ Size of the sprite
+
+ @param height
Size of the sprite
@param rSpriteCanvas
@@ -67,8 +70,9 @@ namespace cairocanvas
@param bShowSpriteBounds
When true, little debug bound rects for sprites are shown
*/
- void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rSpriteCanvas );
+ void init( double width,
+ double height,
+ const SpriteCanvasRef& rSpriteCanvas );
void disposing();
diff --git a/canvas/source/directx/dx_bitmapcanvashelper.cxx b/canvas/source/directx/dx_bitmapcanvashelper.cxx
index e9577e1..25385b7 100644
--- a/canvas/source/directx/dx_bitmapcanvashelper.cxx
+++ b/canvas/source/directx/dx_bitmapcanvashelper.cxx
@@ -148,8 +148,9 @@ namespace dxcanvas
return basegfx::unotools::integerSize2DFromB2ISize(mpTarget->getSize());
}
- uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/,
- sal_Bool /*beFast*/ )
+ uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( double,
+ double,
+ sal_Bool /*beFast*/ )
{
// TODO(F1):
return uno::Reference< rendering::XBitmap >();
diff --git a/canvas/source/directx/dx_bitmapcanvashelper.hxx b/canvas/source/directx/dx_bitmapcanvashelper.hxx
index 670544a..4d48317 100644
--- a/canvas/source/directx/dx_bitmapcanvashelper.hxx
+++ b/canvas/source/directx/dx_bitmapcanvashelper.hxx
@@ -95,8 +95,9 @@ namespace dxcanvas
::com::sun::star::geometry::IntegerSize2D getSize();
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
- getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize,
- sal_Bool beFast );
+ getScaledBitmap( double width,
+ double height,
+ sal_Bool beFast );
::com::sun::star::uno::Sequence< sal_Int8 >
getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx
index 2eead3c..d129142 100644
--- a/canvas/source/directx/dx_canvascustomsprite.cxx
+++ b/canvas/source/directx/dx_canvascustomsprite.cxx
@@ -38,7 +38,8 @@ using namespace ::com::sun::star;
namespace dxcanvas
{
- CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
+ CanvasCustomSprite::CanvasCustomSprite( double width,
+ double height,
const SpriteCanvasRef& rRefDevice,
const IDXRenderModuleSharedPtr& rRenderModule,
const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy,
@@ -52,8 +53,8 @@ namespace dxcanvas
mpSurface.reset(
new DXSurfaceBitmap(
::basegfx::B2IVector(
- ::canvas::tools::roundUp( rSpriteSize.Width ),
- ::canvas::tools::roundUp( rSpriteSize.Height )),
+ ::canvas::tools::roundUp( width ),
+ ::canvas::tools::roundUp( height )),
rSurfaceProxy,
rRenderModule,
true));
@@ -61,7 +62,7 @@ namespace dxcanvas
maCanvasHelper.setDevice( *rRefDevice.get() );
maCanvasHelper.setTarget( mpSurface );
- maSpriteHelper.init( rSpriteSize,
+ maSpriteHelper.init( width, height,
rRefDevice,
rRenderModule,
mpSurface,
diff --git a/canvas/source/directx/dx_canvascustomsprite.hxx b/canvas/source/directx/dx_canvascustomsprite.hxx
index 1b0d57a..9d6b9cb 100644
--- a/canvas/source/directx/dx_canvascustomsprite.hxx
+++ b/canvas/source/directx/dx_canvascustomsprite.hxx
@@ -96,7 +96,8 @@ namespace dxcanvas
@param rDevice
Target DX device
*/
- CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
+ CanvasCustomSprite( double width,
+ double height,
const SpriteCanvasRef& rRefDevice,
const IDXRenderModuleSharedPtr& rRenderModule,
const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy,
diff --git a/canvas/source/directx/dx_devicehelper.cxx b/canvas/source/directx/dx_devicehelper.cxx
index 3f15f0d..c2778af 100644
--- a/canvas/source/directx/dx_devicehelper.cxx
+++ b/canvas/source/directx/dx_devicehelper.cxx
@@ -131,14 +131,14 @@ namespace dxcanvas
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
- const geometry::IntegerSize2D& size )
+ sal_Int32 width, sal_Int32 height )
{
if( !mpDevice )
return uno::Reference< rendering::XBitmap >(); // we're disposed
DXBitmapSharedPtr pBitmap(
new DXBitmap(
- ::basegfx::unotools::b2ISizeFromIntegerSize2D(size),
+ ::basegfx::B2ISize(width, height),
false));
// create a 24bit RGB system memory surface
@@ -147,21 +147,21 @@ namespace dxcanvas
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
- const geometry::IntegerSize2D& /*size*/ )
+ sal_Int32, sal_Int32 )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
- const geometry::IntegerSize2D& size )
+ sal_Int32 width, sal_Int32 height )
{
if( !mpDevice )
return uno::Reference< rendering::XBitmap >(); // we're disposed
DXBitmapSharedPtr pBitmap(
new DXBitmap(
- ::basegfx::unotools::b2ISizeFromIntegerSize2D(size),
+ ::basegfx::B2ISize(width, height),
true));
// create a 32bit ARGB system memory surface
@@ -170,7 +170,7 @@ namespace dxcanvas
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
- const geometry::IntegerSize2D& /*size*/ )
+ sal_Int32, sal_Int32 )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
diff --git a/canvas/source/directx/dx_devicehelper.hxx b/canvas/source/directx/dx_devicehelper.hxx
index abc9eae..6c8d27dd 100644
--- a/canvas/source/directx/dx_devicehelper.hxx
+++ b/canvas/source/directx/dx_devicehelper.hxx
@@ -67,16 +67,16 @@ namespace dxcanvas
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
- const ::com::sun::star::geometry::IntegerSize2D& size );
+ sal_Int32 width, sal_Int32 height );
sal_Bool hasFullScreenMode();
sal_Bool enterFullScreenMode( sal_Bool bEnter );
diff --git a/canvas/source/directx/dx_spritecanvashelper.cxx b/canvas/source/directx/dx_spritecanvashelper.cxx
index 2f0e3a2..0800170 100644
--- a/canvas/source/directx/dx_spritecanvashelper.cxx
+++ b/canvas/source/directx/dx_spritecanvashelper.cxx
@@ -153,13 +153,13 @@ namespace dxcanvas
return uno::Reference< rendering::XAnimatedSprite >();
}
- uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( const geometry::RealSize2D& spriteSize )
+ uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( double width, double height )
{
if( !mpRedrawManager )
return uno::Reference< rendering::XCustomSprite >(); // we're disposed
return uno::Reference< rendering::XCustomSprite >(
- new CanvasCustomSprite( spriteSize,
+ new CanvasCustomSprite( width, height,
mpSpriteSurface,
mpRenderModule,
mpSurfaceProxy,
diff --git a/canvas/source/directx/dx_spritecanvashelper.hxx b/canvas/source/directx/dx_spritecanvashelper.hxx
index fe46427..afbff82 100644
--- a/canvas/source/directx/dx_spritecanvashelper.hxx
+++ b/canvas/source/directx/dx_spritecanvashelper.hxx
@@ -67,7 +67,7 @@ namespace dxcanvas
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCustomSprite > createCustomSprite(
- const ::com::sun::star::geometry::RealSize2D& spriteSize );
+ double width, double height );
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSprite > createClonedSprite(
diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.cxx b/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
index 1d132cb..84915a4 100644
--- a/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
+++ b/canvas/source/opengl/ogl_bitmapcanvashelper.cxx
@@ -51,8 +51,9 @@ namespace oglcanvas
return maSize;
}
- uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/,
- sal_Bool /*beFast*/ )
+ uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( double,
+ double,
+ sal_Bool /*beFast*/ )
{
// TODO(F1):
return uno::Reference< rendering::XBitmap >();
diff --git a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
index 50781c3..28b8fac 100644
--- a/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
+++ b/canvas/source/opengl/ogl_bitmapcanvashelper.hxx
@@ -70,8 +70,9 @@ namespace oglcanvas
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > queryBitmapCanvas();
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
- getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize,
- sal_Bool beFast );
+ getScaledBitmap( double width,
+ double height,
+ sal_Bool beFast );
::com::sun::star::uno::Sequence< sal_Int8 >
getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
diff --git a/canvas/source/opengl/ogl_canvasbitmap.cxx b/canvas/source/opengl/ogl_canvasbitmap.cxx
index d78baf5..7c2c884 100644
--- a/canvas/source/opengl/ogl_canvasbitmap.cxx
+++ b/canvas/source/opengl/ogl_canvasbitmap.cxx
@@ -18,17 +18,19 @@ using namespace ::com::sun::star;
namespace oglcanvas
{
- CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize,
- const SpriteCanvasRef& rDevice,
- SpriteDeviceHelper& rDeviceHelper,
- bool bHasAlpha ) :
+ CanvasBitmap::CanvasBitmap( sal_Int32 width,
+ sal_Int32 height,
+ const SpriteCanvasRef& rDevice,
+ SpriteDeviceHelper& rDeviceHelper,
+ bool bHasAlpha ) :
mpDevice( rDevice ),
mbHasAlpha( bHasAlpha )
{
ENSURE_OR_THROW( mpDevice.is(),
"CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
- maCanvasHelper.init( *mpDevice.get(), rDeviceHelper, rSize );
+ maCanvasHelper.init( *mpDevice.get(), rDeviceHelper,
+ geometry::IntegerSize2D(width, height) );
}
CanvasBitmap::CanvasBitmap( const CanvasBitmap& rSrc ) :
diff --git a/canvas/source/opengl/ogl_canvasbitmap.hxx b/canvas/source/opengl/ogl_canvasbitmap.hxx
index b874bde..1f0f93a 100644
--- a/canvas/source/opengl/ogl_canvasbitmap.hxx
+++ b/canvas/source/opengl/ogl_canvasbitmap.hxx
@@ -42,16 +42,20 @@ namespace oglcanvas
public:
/** Create a canvas bitmap for the given surface
- @param rSize
+ @param width
+ Size of the bitmap
+
+ @param height
Size of the bitmap
@param rDevice
Reference device, with which bitmap should be compatible
*/
- CanvasBitmap( const ::com::sun::star::geometry::IntegerSize2D& rSize,
- const SpriteCanvasRef& rDevice,
- SpriteDeviceHelper& rDeviceHelper,
- bool bHasAlpha );
+ CanvasBitmap( sal_Int32 width,
+ sal_Int32 height,
+ const SpriteCanvasRef& rDevice,
+ SpriteDeviceHelper& rDeviceHelper,
+ bool bHasAlpha );
/** Create verbatim copy (including all recorded actions)
*/
diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx
index 7c08671..d580b84 100644
--- a/canvas/source/opengl/ogl_canvascustomsprite.cxx
+++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx
@@ -34,11 +34,12 @@ using namespace ::com::sun::star;
namespace oglcanvas
{
- CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rRefDevice,
- SpriteDeviceHelper& rDeviceHelper ) :
+ CanvasCustomSprite::CanvasCustomSprite( double width,
+ double height,
+ const SpriteCanvasRef& rRefDevice,
+ SpriteDeviceHelper& rDeviceHelper ) :
mpSpriteCanvas( rRefDevice ),
- maSize(rSpriteSize),
+ maSize(width, height),
mxClip(),
maTransformation(),
maPosition(),
diff --git a/canvas/source/opengl/ogl_canvascustomsprite.hxx b/canvas/source/opengl/ogl_canvascustomsprite.hxx
index a96ce64..b8050eb 100644
--- a/canvas/source/opengl/ogl_canvascustomsprite.hxx
+++ b/canvas/source/opengl/ogl_canvascustomsprite.hxx
@@ -44,7 +44,10 @@ namespace oglcanvas
public:
/** Create a custom sprite
- @param rSpriteSize
+ @param width
+ Size of the sprite in pixel
+
+ @param height
Size of the sprite in pixel
@param rRefDevice
@@ -56,9 +59,10 @@ namespace oglcanvas
@param rDevice
Target DX device
*/
- CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
- const SpriteCanvasRef& rRefDevice,
- SpriteDeviceHelper& rDeviceHelper );
+ CanvasCustomSprite( double width,
+ double height,
+ const SpriteCanvasRef& rRefDevice,
+ SpriteDeviceHelper& rDeviceHelper );
virtual void disposeThis();
diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx
index ad02eb1..6d2fa72 100644
--- a/canvas/source/opengl/ogl_spritecanvas.cxx
+++ b/canvas/source/opengl/ogl_spritecanvas.cxx
@@ -130,11 +130,11 @@ namespace oglcanvas
}
uno::Reference< rendering::XCustomSprite > SAL_CALL SpriteCanvas::createCustomSprite(
- const geometry::RealSize2D& spriteSize ) throw (lang::IllegalArgumentException,
+ double width, double height ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
return uno::Reference< rendering::XCustomSprite >(
- new CanvasCustomSprite(spriteSize, this, maDeviceHelper) );
+ new CanvasCustomSprite(width, height, this, maDeviceHelper) );
}
uno::Reference< rendering::XSprite > SAL_CALL SpriteCanvas::createClonedSprite(
diff --git a/canvas/source/opengl/ogl_spritecanvas.hxx b/canvas/source/opengl/ogl_spritecanvas.hxx
index 6efc6db..5279879 100644
--- a/canvas/source/opengl/ogl_spritecanvas.hxx
+++ b/canvas/source/opengl/ogl_spritecanvas.hxx
@@ -91,7 +91,7 @@ namespace oglcanvas
// XSpriteCanvas
virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimatedSprite > SAL_CALL createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list