diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-11-02 23:36:36 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-11-02 23:58:28 +0100 |
commit | 1e297aef53ec79e2905cb9ca57d649b82bc3938d (patch) | |
tree | f5ec93d4b92881eb59ed50c2aee7200e25e5cbd2 /vcl | |
parent | aeee94cb587082430f3a277a24ae459829f6d384 (diff) |
Move BitmapDevice to use B2IBox instead of B2IRange.
Semantically, B2IBox represents a pixel rect much better than
B2IRange - replaced all occurences in and around the software
renderer, and client code.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 4 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 70 | ||||
-rw-r--r-- | vcl/headless/svptext.cxx | 6 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 6 |
6 files changed, 45 insertions, 45 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index f385682afada..d27b7654c56f 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -29,7 +29,7 @@ #include "headless/svpbmp.hxx" #include <basegfx/vector/b2ivector.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basebmp/scanlineformats.hxx> #include <basebmp/color.hxx> @@ -96,7 +96,7 @@ bool SvpSalBitmap::Create( const SalBitmap& rSalBmp ) { B2IVector aSize = rSrcBmp->getSize(); m_aBitmap = cloneBitmapDevice( aSize, rSrcBmp ); - B2IRange aRect( 0, 0, aSize.getX(), aSize.getY() ); + B2IBox aRect( 0, 0, aSize.getX(), aSize.getY() ); m_aBitmap->drawBitmap( rSrcBmp, aRect, aRect, DrawMode_PAINT ); } else diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 2a086b33c340..decd04d4f40f 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -31,7 +31,7 @@ #include <vcl/sysdata.hxx> #include <basegfx/range/b2drange.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -199,7 +199,7 @@ SvpSalGraphics::ClipUndoHandle::~ClipUndoHandle() // will avoid setting up the clip bitmap. Similarly if the // range doesn't appear at all we return true to avoid // rendering -bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGraphics::ClipUndoHandle &rUndo ) +bool SvpSalGraphics::isClippedSetup( const basegfx::B2IBox &aRange, SvpSalGraphics::ClipUndoHandle &rUndo ) { if( m_bClipSetup ) return false; @@ -244,10 +244,10 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGrap // fprintf (stderr, " operation only overlaps with a single clip zone\n" ); rUndo.m_aDevice = m_aDevice; m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, - basegfx::B2IRange (aHitRect.Left(), - aHitRect.Top(), - aHitRect.Right(), - aHitRect.Bottom()) ); + basegfx::B2IBox (aHitRect.Left(), + aHitRect.Top(), + aHitRect.Right(), + aHitRect.Bottom()) ); return false; } // fprintf (stderr, "URK: complex & slow clipping case\n" ); @@ -281,7 +281,7 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip ) m_aClipMap.reset(); Rectangle aBoundRect( i_rClip.GetBoundRect() ); m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, - basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) ); + basegfx::B2IBox(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) ); m_bClipSetup = true; } else @@ -531,8 +531,8 @@ void SvpSalGraphics::copyArea( long nDestX, long nSrcHeight, sal_uInt16 /*nFlags*/ ) { - B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight ); - B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight ); + B2IBox aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight ); + B2IBox aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight ); // fprintf( stderr, "copyArea %ld pixels - clip region %d\n", // (long)(nSrcWidth * nSrcHeight), m_aClipMap.get() != NULL ); SvpSalGraphics::ClipUndoHandle aUndo( this ); @@ -546,12 +546,12 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry, { SvpSalGraphics* pSrc = pSrcGraphics ? static_cast<SvpSalGraphics*>(pSrcGraphics) : this; - B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, - pPosAry->mnSrcX+pPosAry->mnSrcWidth, - pPosAry->mnSrcY+pPosAry->mnSrcHeight ); - B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, - pPosAry->mnDestX+pPosAry->mnDestWidth, - pPosAry->mnDestY+pPosAry->mnDestHeight ); + B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, + pPosAry->mnSrcX+pPosAry->mnSrcWidth, + pPosAry->mnSrcY+pPosAry->mnSrcHeight ); + B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, + pPosAry->mnDestX+pPosAry->mnDestWidth, + pPosAry->mnDestY+pPosAry->mnDestHeight ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aDestRect, aUndo ) ) @@ -563,12 +563,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) { const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); - B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, - pPosAry->mnSrcX+pPosAry->mnSrcWidth, - pPosAry->mnSrcY+pPosAry->mnSrcHeight ); - B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, - pPosAry->mnDestX+pPosAry->mnDestWidth, - pPosAry->mnDestY+pPosAry->mnDestHeight ); + B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, + pPosAry->mnSrcX+pPosAry->mnSrcWidth, + pPosAry->mnSrcY+pPosAry->mnSrcHeight ); + B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, + pPosAry->mnDestX+pPosAry->mnDestWidth, + pPosAry->mnDestY+pPosAry->mnDestHeight ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aDestRect, aUndo ) ) @@ -589,12 +589,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry, { const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap); - B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, - pPosAry->mnSrcX+pPosAry->mnSrcWidth, - pPosAry->mnSrcY+pPosAry->mnSrcHeight ); - B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, - pPosAry->mnDestX+pPosAry->mnDestWidth, - pPosAry->mnDestY+pPosAry->mnDestHeight ); + B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, + pPosAry->mnSrcX+pPosAry->mnSrcWidth, + pPosAry->mnSrcY+pPosAry->mnSrcHeight ); + B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, + pPosAry->mnDestX+pPosAry->mnDestWidth, + pPosAry->mnDestY+pPosAry->mnDestHeight ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aDestRect, aUndo ) ) m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(), @@ -607,9 +607,9 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry, SalColor nMaskColor ) { const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); - B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, - pPosAry->mnSrcX+pPosAry->mnSrcWidth, - pPosAry->mnSrcY+pPosAry->mnSrcHeight ); + B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, + pPosAry->mnSrcX+pPosAry->mnSrcWidth, + pPosAry->mnSrcY+pPosAry->mnSrcHeight ); B2IPoint aDestPoint( pPosAry->mnDestX, pPosAry->mnDestY ); // BitmapDevice::drawMaskedColor works with 0==transparent, @@ -624,8 +624,8 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry, aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() ); basebmp::Color aColor( nMaskColor ); - B2IRange aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ); - const B2IRange aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) ); + B2IBox aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ); + const B2IBox aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aClipRect, aUndo ) ) @@ -638,8 +638,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh BitmapDeviceSharedPtr aCopy = cloneBitmapDevice( B2IVector( nWidth, nHeight ), m_aDevice ); - B2IRange aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); - B2IRange aDestRect( 0, 0, nWidth, nHeight ); + B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); + B2IBox aDestRect( 0, 0, nWidth, nHeight ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aDestRect, aUndo ) ) @@ -661,7 +661,7 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME B2DPolygon aRect = tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); B2DPolyPolygon aPolyPoly( aRect ); - B2IRange aDestRange( nX, nY, nX + nWidth, nY + nHeight ); + B2IBox aDestRange( nX, nY, nX + nWidth, nY + nHeight ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aDestRange, aUndo ) ) diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 866a49f70d91..ff649a1ce454 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -27,7 +27,7 @@ ************************************************************************/ #include <basegfx/range/b2drange.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basebmp/scanlineformats.hxx> @@ -532,8 +532,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) continue; // blend text color into target using the glyph's mask - const B2IRange aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() ); - const B2IRange aClipRect( aDstPoint, aAlphaMask->getSize() ); + const B2IBox aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() ); + const B2IBox aClipRect( aDstPoint, aAlphaMask->getSize() ); SvpSalGraphics::ClipUndoHandle aUndo( this ); if( !isClippedSetup( aClipRect, aUndo ) ) diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index b08edba55ed0..31ae2530ccc5 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -66,7 +66,7 @@ private: ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {} ~ClipUndoHandle(); }; - bool isClippedSetup( const basegfx::B2IRange &aRange, ClipUndoHandle &rUndo ); + bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo ); void ensureClip(); protected: diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 43f420d895ee..696e08e76ced 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -432,7 +432,7 @@ public: static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); - virtual void damaged (const basegfx::B2IRange& rDamageRect); + virtual void damaged (const basegfx::B2IBox& rDamageRect); }; #define OOO_TYPE_FIXED ooo_fixed_get_type() diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index cb780e97df92..667b09756ce8 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -56,7 +56,7 @@ #include <svids.hrc> #include <sal/macros.h> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/vector/b2ivector.hxx> #include <algorithm> @@ -352,7 +352,7 @@ struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker { DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame) {} - virtual void damaged(const basegfx::B2IRange& rDamageRect) const + virtual void damaged(const basegfx::B2IBox& rDamageRect) const { m_rFrame.damaged(rDamageRect); } @@ -3014,7 +3014,7 @@ void GtkSalFrame::popIgnoreDamage() #endif } -void GtkSalFrame::damaged (const basegfx::B2IRange& rDamageRect) +void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) { #if !GTK_CHECK_VERSION(3,0,0) (void)rDamageRect; |