summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2012-01-31 01:04:10 +0100
committerThorsten Behrens <tbehrens@suse.com>2013-10-07 17:33:45 +0200
commit21ec9beae29b19b8ec6f0a16fd0e708e4f210208 (patch)
tree84b5d635ba0c39282665dea33f40348a1ca73178
parent3e2dba1accbd018f7dac362a2636bed135f1b5bb (diff)
XCanvas does no longer imply XBitmapCanvas
Remove the implication that XCanvas IS-A XBitmapCanvas, i.e. one can access underlying pixels. That's a preparation for display-list based canvas implementations, and was a rather silly assumption in the first place. Also fixes up all client sites. Change-Id: I7a3d6f68ef46fe94b23cce7759cc0b8b6ca4dae9
-rw-r--r--canvas/source/cairo/cairo_canvashelper.hxx1
-rw-r--r--canvas/source/directx/dx_bitmapcanvashelper.hxx1
-rw-r--r--canvas/source/directx/dx_canvashelper.hxx2
-rw-r--r--canvas/source/tools/canvastools.cxx10
-rw-r--r--canvas/source/vcl/canvashelper.hxx1
-rw-r--r--cppcanvas/source/wrapper/implspritecanvas.cxx4
-rw-r--r--cppcanvas/source/wrapper/implspritecanvas.hxx4
-rw-r--r--include/cppcanvas/spritecanvas.hxx4
-rw-r--r--offapi/com/sun/star/rendering/XSpriteCanvas.idl11
-rw-r--r--sd/source/ui/presenter/PresenterCanvas.cxx11
-rw-r--r--sd/source/ui/presenter/PresenterCanvas.hxx4
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx1
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx1
-rw-r--r--sdext/source/presenter/PresenterSlideSorter.cxx1
-rw-r--r--slideshow/source/engine/slideview.cxx9
-rw-r--r--slideshow/source/engine/transitions/slidechangebase.cxx1
-rw-r--r--slideshow/source/engine/waitsymbol.cxx13
17 files changed, 36 insertions, 43 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx
index f1d29727d3de..8b83d2c292fa 100644
--- a/canvas/source/cairo/cairo_canvashelper.hxx
+++ b/canvas/source/cairo/cairo_canvashelper.hxx
@@ -21,6 +21,7 @@
#define _CAIROCANVAS_CANVASHELPER_HXX_
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <basegfx/vector/b2isize.hxx>
diff --git a/canvas/source/directx/dx_bitmapcanvashelper.hxx b/canvas/source/directx/dx_bitmapcanvashelper.hxx
index cb0016a892ee..670544a0c6ab 100644
--- a/canvas/source/directx/dx_bitmapcanvashelper.hxx
+++ b/canvas/source/directx/dx_bitmapcanvashelper.hxx
@@ -21,6 +21,7 @@
#define _DXCANVAS_BITMAPCANVASHELPER_HXX_
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/vector/b2dsize.hxx>
diff --git a/canvas/source/directx/dx_canvashelper.hxx b/canvas/source/directx/dx_canvashelper.hxx
index 157d6113c47b..5a6527d2fd29 100644
--- a/canvas/source/directx/dx_canvashelper.hxx
+++ b/canvas/source/directx/dx_canvashelper.hxx
@@ -21,6 +21,8 @@
#define _DXCANVAS_CANVASHELPER_HXX_
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
+#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/vector/b2dsize.hxx>
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx
index 26775befb3b4..d6b949b511c5 100644
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -387,7 +387,7 @@ namespace canvas
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
- *pOut++ = vcl::unotools::toDoubleColor(255-*pIn++);
+ *pOut++ = vcl::unotools::toDoubleColor(*pIn++);
}
return aRes;
}
@@ -452,7 +452,7 @@ namespace canvas
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::ARGBColor(
- vcl::unotools::toDoubleColor(255-pIn[3]),
+ vcl::unotools::toDoubleColor(pIn[3]),
vcl::unotools::toDoubleColor(pIn[0]),
vcl::unotools::toDoubleColor(pIn[1]),
vcl::unotools::toDoubleColor(pIn[2]));
@@ -473,7 +473,7 @@ namespace canvas
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
- const sal_Int8 nAlpha( 255-pIn[3] );
+ const sal_Int8 nAlpha( pIn[3] );
*pOut++ = rendering::ARGBColor(
vcl::unotools::toDoubleColor(nAlpha),
vcl::unotools::toDoubleColor(nAlpha*pIn[0]),
@@ -514,7 +514,7 @@ namespace canvas
*pColors++ = vcl::unotools::toByteColor(pIn->Red);
*pColors++ = vcl::unotools::toByteColor(pIn->Green);
*pColors++ = vcl::unotools::toByteColor(pIn->Blue);
- *pColors++ = 255-vcl::unotools::toByteColor(pIn->Alpha);
+ *pColors++ = vcl::unotools::toByteColor(pIn->Alpha);
++pIn;
}
return aRes;
@@ -532,7 +532,7 @@ namespace canvas
*pColors++ = vcl::unotools::toByteColor(pIn->Red/pIn->Alpha);
*pColors++ = vcl::unotools::toByteColor(pIn->Green/pIn->Alpha);
*pColors++ = vcl::unotools::toByteColor(pIn->Blue/pIn->Alpha);
- *pColors++ = 255-vcl::unotools::toByteColor(pIn->Alpha);
+ *pColors++ = vcl::unotools::toByteColor(pIn->Alpha);
++pIn;
}
return aRes;
diff --git a/canvas/source/vcl/canvashelper.hxx b/canvas/source/vcl/canvashelper.hxx
index f112b79d2041..69af00c13d6c 100644
--- a/canvas/source/vcl/canvashelper.hxx
+++ b/canvas/source/vcl/canvashelper.hxx
@@ -21,6 +21,7 @@
#define _VCLCANVAS_CANVASHELPER_HXX_
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <vcl/outdev.hxx>
diff --git a/cppcanvas/source/wrapper/implspritecanvas.cxx b/cppcanvas/source/wrapper/implspritecanvas.cxx
index c6b43a6a9af1..78701786fe15 100644
--- a/cppcanvas/source/wrapper/implspritecanvas.cxx
+++ b/cppcanvas/source/wrapper/implspritecanvas.cxx
@@ -51,8 +51,6 @@ namespace cppcanvas
ImplSpriteCanvas::ImplSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& rCanvas ) :
ImplCanvas( uno::Reference< rendering::XCanvas >(rCanvas,
uno::UNO_QUERY) ),
- ImplBitmapCanvas( uno::Reference< rendering::XBitmapCanvas >(rCanvas,
- uno::UNO_QUERY) ),
mxSpriteCanvas( rCanvas ),
mpTransformArbiter( new TransformationArbiter() )
{
@@ -61,10 +59,8 @@ namespace cppcanvas
ImplSpriteCanvas::ImplSpriteCanvas(const ImplSpriteCanvas& rOrig) :
Canvas(),
- BitmapCanvas(),
SpriteCanvas(),
ImplCanvas( rOrig ),
- ImplBitmapCanvas( rOrig ),
mxSpriteCanvas( rOrig.getUNOSpriteCanvas() ),
mpTransformArbiter( new TransformationArbiter() )
{
diff --git a/cppcanvas/source/wrapper/implspritecanvas.hxx b/cppcanvas/source/wrapper/implspritecanvas.hxx
index 2e70b9aa42f1..1999c5630ff0 100644
--- a/cppcanvas/source/wrapper/implspritecanvas.hxx
+++ b/cppcanvas/source/wrapper/implspritecanvas.hxx
@@ -29,14 +29,14 @@
#include <cppcanvas/spritecanvas.hxx>
-#include <implbitmapcanvas.hxx>
+#include <implcanvas.hxx>
namespace cppcanvas
{
namespace internal
{
- class ImplSpriteCanvas : public virtual SpriteCanvas, protected virtual ImplBitmapCanvas
+ class ImplSpriteCanvas : public virtual SpriteCanvas, protected virtual ImplCanvas
{
public:
ImplSpriteCanvas( const ::com::sun::star::uno::Reference<
diff --git a/include/cppcanvas/spritecanvas.hxx b/include/cppcanvas/spritecanvas.hxx
index 6a606b331edf..75732448e819 100644
--- a/include/cppcanvas/spritecanvas.hxx
+++ b/include/cppcanvas/spritecanvas.hxx
@@ -28,7 +28,7 @@
#include <boost/shared_ptr.hpp>
-#include <cppcanvas/bitmapcanvas.hxx>
+#include <cppcanvas/canvas.hxx>
#include <cppcanvas/sprite.hxx>
#include <cppcanvas/customsprite.hxx>
@@ -49,7 +49,7 @@ namespace cppcanvas
/** SpriteCanvas interface
*/
- class SpriteCanvas : public virtual BitmapCanvas, private boost::noncopyable
+ class SpriteCanvas : public virtual Canvas, private boost::noncopyable
{
public:
virtual bool updateScreen( bool bUpdateAll ) const = 0;
diff --git a/offapi/com/sun/star/rendering/XSpriteCanvas.idl b/offapi/com/sun/star/rendering/XSpriteCanvas.idl
index eb98a4f3e830..f15b02b8efeb 100644
--- a/offapi/com/sun/star/rendering/XSpriteCanvas.idl
+++ b/offapi/com/sun/star/rendering/XSpriteCanvas.idl
@@ -30,7 +30,7 @@ interface XSprite;
interface XAnimatedSprite;
interface XCustomSprite;
-/** Specialization of a XBitmapCanvas, where moving, animated objects
+/** Specialization of a XCanvas, where moving, animated objects
(called sprites) are supported.<p>
@attention The screen output of canvas drawing operations is
@@ -44,9 +44,9 @@ interface XCustomSprite;
(because there's a defined moment in time where content display
can happen, namely the XBufferController::showBuffer()) call. If
you don't need sprite functionality, and don't want the
- updateScreen hassle, simply use the XBitmapCanvas.
+ updateScreen hassle, simply use the XCanvas.
*/
-interface XSpriteCanvas : XBitmapCanvas
+interface XSpriteCanvas : XCanvas
{
/** Create a sprite object from the specified animation
sequence. A sprite is a back-buffered object with its own,
@@ -98,9 +98,8 @@ interface XSpriteCanvas : XBitmapCanvas
object.
The cloned sprite always shows the same content as its
- original. Furthermore, cloned copies of a hidden original are
- never visible, although cloned copies of a visible original
- can of course be invisible.
+ original, but of course the sprite position, visibility, alpha
+ etc. can be modified independently.
@param original
The original sprite to copy the content from. This sprite must
diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx
index f93cade9dec4..415c339026ec 100644
--- a/sd/source/ui/presenter/PresenterCanvas.cxx
+++ b/sd/source/ui/presenter/PresenterCanvas.cxx
@@ -790,17 +790,6 @@ sal_Bool SAL_CALL PresenterCanvas::hasAlpha (void)
-Reference<rendering::XBitmapCanvas> SAL_CALL PresenterCanvas::queryBitmapCanvas (void)
- throw (RuntimeException)
-{
- ThrowIfDisposed();
-
- return this;
-}
-
-
-
-
Reference<rendering::XBitmap> SAL_CALL PresenterCanvas::getScaledBitmap(
const css::geometry::RealSize2D& rNewSize,
sal_Bool bFast)
diff --git a/sd/source/ui/presenter/PresenterCanvas.hxx b/sd/source/ui/presenter/PresenterCanvas.hxx
index b2447d1bec62..46d637eabf05 100644
--- a/sd/source/ui/presenter/PresenterCanvas.hxx
+++ b/sd/source/ui/presenter/PresenterCanvas.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/VolatileContentDestroyedException.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase4.hxx>
@@ -373,9 +374,6 @@ public:
virtual sal_Bool SAL_CALL hasAlpha (void)
throw (css::uno::RuntimeException);
- virtual css::uno::Reference<css::rendering::XBitmapCanvas> SAL_CALL queryBitmapCanvas (void)
- throw (css::uno::RuntimeException);
-
virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL getScaledBitmap(
const css::geometry::RealSize2D& rNewSize,
sal_Bool bFast)
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index f7704986852d..9498212b90a5 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index 6bf192a70baa..9cdfcf8cc19d 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -21,6 +21,7 @@
#include "SlideRenderer.hxx"
#include "sdpage.hxx"
#include <toolkit/helper/vclunohelper.hxx>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <cppcanvas/vclfactory.hxx>
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index 19ec57ed7b26..d8ab28177f94 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/drawing/XSlideSorterBase.hpp>
#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/TextDirection.hpp>
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 0d147b9bb64e..2d2c42153318 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -909,6 +909,11 @@ void SlideView::clearAll() const
if( !mxView.is() || !mpCanvas )
return;
+ mpCanvas->clear(); // 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();
}
@@ -1126,10 +1131,6 @@ void SlideView::updateCanvas()
if( !mpCanvas || !mxView.is())
return;
- mpCanvas->clear(); // 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
clearAll();
mpCanvas->setTransformation( getTransformation() );
mpCanvas->setClip(
diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx
index 56d7887fdb07..dd0cabfbce4d 100644
--- a/slideshow/source/engine/transitions/slidechangebase.cxx
+++ b/slideshow/source/engine/transitions/slidechangebase.cxx
@@ -231,6 +231,7 @@ void SlideChangeBase::end()
const SlideBitmapSharedPtr pSlideBitmap( getEnteringBitmap( *aCurr ));
pSlideBitmap->clip( basegfx::B2DPolyPolygon() /* no clipping */ );
+ aCurr->mpView->clearAll();
renderBitmap( pSlideBitmap,
aCurr->mpView->getCanvas() );
diff --git a/slideshow/source/engine/waitsymbol.cxx b/slideshow/source/engine/waitsymbol.cxx
index 6c56ac795749..2017d7419ed1 100644
--- a/slideshow/source/engine/waitsymbol.cxx
+++ b/slideshow/source/engine/waitsymbol.cxx
@@ -28,6 +28,7 @@
#include <basegfx/vector/b2dvector.hxx>
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/presentation/XSlideShowView.hpp>
#include "waitsymbol.hxx"
#include "eventmultiplexer.hxx"
@@ -103,13 +104,13 @@ void WaitSymbol::setVisible( const bool bVisible )
basegfx::B2DPoint WaitSymbol::calcSpritePos(
UnoViewSharedPtr const & rView ) const
{
- const uno::Reference<rendering::XBitmap> xBitmap( rView->getCanvas()->getUNOCanvas(),
- uno::UNO_QUERY_THROW );
- const geometry::IntegerSize2D realSize( xBitmap->getSize() );
+ const awt::Rectangle aViewArea( rView->getUnoView()->getCanvasArea() );
return basegfx::B2DPoint(
- std::min<sal_Int32>( realSize.Width, LEFT_BORDER_SPACE ),
- std::max<sal_Int32>( 0, realSize.Height - mxBitmap->getSize().Height
- - LOWER_BORDER_SPACE ) );
+ aViewArea.X + std::min<sal_Int32>( aViewArea.Width, LEFT_BORDER_SPACE ),
+ aViewArea.X + std::max<sal_Int32>( 0,
+ aViewArea.Height
+ - mxBitmap->getSize().Height
+ - LOWER_BORDER_SPACE ) );
}
void WaitSymbol::viewAdded( const UnoViewSharedPtr& rView )