Kaydet (Commit) 1e297aef authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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.
üst aeee94cb
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <basegfx/tools/rectcliptools.hxx> #include <basegfx/tools/rectcliptools.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <vigra/diff2d.hxx> #include <vigra/diff2d.hxx>
#include <vigra/iteratortraits.hxx> #include <vigra/iteratortraits.hxx>
...@@ -200,7 +200,7 @@ inline bool prepareClip( sal_Int32 a1, ...@@ -200,7 +200,7 @@ inline bool prepareClip( sal_Int32 a1,
template< class Iterator, class Accessor > template< class Iterator, class Accessor >
void renderClippedLine( basegfx::B2IPoint aPt1, void renderClippedLine( basegfx::B2IPoint aPt1,
basegfx::B2IPoint aPt2, basegfx::B2IPoint aPt2,
const basegfx::B2IRange& rClipRect, const basegfx::B2IBox& rClipRect,
typename Accessor::value_type color, typename Accessor::value_type color,
Iterator begin, Iterator begin,
Accessor acc, Accessor acc,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <basegfx/point/b2dpoint.hxx> #include <basegfx/point/b2dpoint.hxx>
#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygonfillrule.hxx> #include <basegfx/polygon/b2dpolypolygonfillrule.hxx>
...@@ -147,7 +147,7 @@ namespace basebmp ...@@ -147,7 +147,7 @@ namespace basebmp
void renderClippedPolyPolygon( DestIterator begin, void renderClippedPolyPolygon( DestIterator begin,
DestAccessor ad, DestAccessor ad,
T fillColor, T fillColor,
const basegfx::B2IRange& rClipRect, const basegfx::B2IBox& rClipRect,
basegfx::B2DPolyPolygon const& rPoly, basegfx::B2DPolyPolygon const& rPoly,
basegfx::FillRule eFillRule ) basegfx::FillRule eFillRule )
{ {
......
...@@ -29,24 +29,24 @@ ...@@ -29,24 +29,24 @@
#ifndef INCLUDED_BASEBMP_TOOLS_HXX #ifndef INCLUDED_BASEBMP_TOOLS_HXX
#define INCLUDED_BASEBMP_TOOLS_HXX #define INCLUDED_BASEBMP_TOOLS_HXX
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <vigra/tuple.hxx> #include <vigra/tuple.hxx>
#include <vigra/diff2d.hxx> #include <vigra/diff2d.hxx>
namespace basebmp namespace basebmp
{ {
inline vigra::Diff2D topLeft( const basegfx::B2IRange& rRange ) inline vigra::Diff2D topLeft( const basegfx::B2IBox& rRange )
{ return vigra::Diff2D(rRange.getMinX(),rRange.getMinY()); } { return vigra::Diff2D(rRange.getMinX(),rRange.getMinY()); }
inline vigra::Diff2D bottomRight( const basegfx::B2IRange& rRange ) inline vigra::Diff2D bottomRight( const basegfx::B2IBox& rRange )
{ return vigra::Diff2D(rRange.getMaxX(),rRange.getMaxY()); } { return vigra::Diff2D(rRange.getMaxX(),rRange.getMaxY()); }
template< class Iterator, class Accessor > template< class Iterator, class Accessor >
inline vigra::triple<Iterator,Iterator,Accessor> inline vigra::triple<Iterator,Iterator,Accessor>
destIterRange(Iterator const& begin, destIterRange(Iterator const& begin,
Accessor const& accessor, Accessor const& accessor,
const basegfx::B2IRange& rRange) const basegfx::B2IBox& rRange)
{ {
return vigra::triple<Iterator,Iterator,Accessor>( return vigra::triple<Iterator,Iterator,Accessor>(
begin + topLeft(rRange), begin + topLeft(rRange),
...@@ -58,7 +58,7 @@ namespace basebmp ...@@ -58,7 +58,7 @@ namespace basebmp
inline vigra::triple<Iterator,Iterator,Accessor> inline vigra::triple<Iterator,Iterator,Accessor>
srcIterRange(Iterator const& begin, srcIterRange(Iterator const& begin,
Accessor const& accessor, Accessor const& accessor,
const basegfx::B2IRange& rRange) const basegfx::B2IBox& rRange)
{ {
return vigra::triple<Iterator,Iterator,Accessor>( return vigra::triple<Iterator,Iterator,Accessor>(
begin + topLeft(rRange), begin + topLeft(rRange),
......
This diff is collapsed.
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/vector/b2enums.hxx> #include <basegfx/vector/b2enums.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
...@@ -1109,7 +1109,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ ) ...@@ -1109,7 +1109,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ )
basebmp::BitmapDeviceSharedPtr pSubsetDevice = basebmp::BitmapDeviceSharedPtr pSubsetDevice =
basebmp::subsetBitmapDevice( pDevice, basebmp::subsetBitmapDevice( pDevice,
basegfx::B2IRange(3,3,7,7) ); basegfx::B2IBox(3,3,7,7) );
const basegfx::B2IPoint aPt1(0,0); const basegfx::B2IPoint aPt1(0,0);
const basegfx::B2IPoint aPt2(1,9); const basegfx::B2IPoint aPt2(1,9);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "cppunit/extensions/HelperMacros.h" #include "cppunit/extensions/HelperMacros.h"
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
...@@ -67,8 +67,8 @@ private: ...@@ -67,8 +67,8 @@ private:
rDevice->clear(Color(0)); rDevice->clear(Color(0));
const Color aCol(0xFFFFFFFF); const Color aCol(0xFFFFFFFF);
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IRange aDestAll(0,0,10,10); const basegfx::B2IBox aDestAll(0,0,10,10);
rDevice->drawMaskedBitmap( rDevice->drawMaskedBitmap(
rBmp, rBmp,
...@@ -86,8 +86,8 @@ private: ...@@ -86,8 +86,8 @@ private:
rDevice->clear(Color(0)); rDevice->clear(Color(0));
const Color aCol(0xFFFFFFFF); const Color aCol(0xFFFFFFFF);
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IRange aDestLeftTop(0,0,6,6); const basegfx::B2IBox aDestLeftTop(0,0,6,6);
rDevice->drawMaskedBitmap( rDevice->drawMaskedBitmap(
rBmp, rBmp,
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "cppunit/extensions/HelperMacros.h" #include "cppunit/extensions/HelperMacros.h"
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
...@@ -66,11 +66,11 @@ private: ...@@ -66,11 +66,11 @@ private:
rDevice->clear(Color(0)); rDevice->clear(Color(0));
const Color aCol(0xFFFFFFFF); const Color aCol(0xFFFFFFFF);
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IRange aDestLeftTop(0,0,4,4); const basegfx::B2IBox aDestLeftTop(0,0,4,4);
const basegfx::B2IRange aDestRightTop(6,0,10,4); const basegfx::B2IBox aDestRightTop(6,0,10,4);
const basegfx::B2IRange aDestLeftBottom(0,6,4,10); const basegfx::B2IBox aDestLeftBottom(0,6,4,10);
const basegfx::B2IRange aDestRightBottom(6,6,10,10); const basegfx::B2IBox aDestRightBottom(6,6,10,10);
rDevice->drawBitmap( rDevice->drawBitmap(
rBmp, rBmp,
...@@ -111,11 +111,11 @@ private: ...@@ -111,11 +111,11 @@ private:
rDevice->clear(Color(0)); rDevice->clear(Color(0));
const Color aCol(0xFFFFFFFF); const Color aCol(0xFFFFFFFF);
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IRange aDestLeftTop(-2,-2,2,2); const basegfx::B2IBox aDestLeftTop(-2,-2,2,2);
const basegfx::B2IRange aDestRightTop(8,-2,12,2); const basegfx::B2IBox aDestRightTop(8,-2,12,2);
const basegfx::B2IRange aDestLeftBottom(-2,8,2,12); const basegfx::B2IBox aDestLeftBottom(-2,8,2,12);
const basegfx::B2IRange aDestRightBottom(8,8,12,12); const basegfx::B2IBox aDestRightBottom(8,8,12,12);
rDevice->drawBitmap( rDevice->drawBitmap(
rBmp, rBmp,
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
...@@ -155,8 +155,8 @@ private: ...@@ -155,8 +155,8 @@ private:
rDevice->clear(aCol1); rDevice->clear(aCol1);
rDevice->drawBitmap(pBmp, rDevice->drawBitmap(pBmp,
basegfx::B2IRange(0,0,3,3), basegfx::B2IBox(0,0,3,3),
basegfx::B2IRange(-1,-1,4,4), basegfx::B2IBox(-1,-1,4,4),
DrawMode_PAINT, DrawMode_PAINT,
mpClipMask); mpClipMask);
...@@ -183,7 +183,7 @@ private: ...@@ -183,7 +183,7 @@ private:
aCol, aCol,
basebmp::DrawMode_PAINT ); basebmp::DrawMode_PAINT );
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IPoint aDestLeftTop(0,0); const basegfx::B2IPoint aDestLeftTop(0,0);
const Color aCol2(0xF0F0F0F0); const Color aCol2(0xF0F0F0F0);
rDevice->drawMaskedColor( rDevice->drawMaskedColor(
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "cppunit/extensions/HelperMacros.h" #include "cppunit/extensions/HelperMacros.h"
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
const Color aCol(0); const Color aCol(0);
const Color aCol2(0xF0F0F0F0); const Color aCol2(0xF0F0F0F0);
const basegfx::B2IRange aSourceRect(0,0,10,10); const basegfx::B2IBox aSourceRect(0,0,10,10);
const basegfx::B2IPoint aDestLeftTop(0,0); const basegfx::B2IPoint aDestLeftTop(0,0);
const basegfx::B2IPoint aDestRightTop(5,0); const basegfx::B2IPoint aDestRightTop(5,0);
const basegfx::B2IPoint aDestLeftBottom(0,5); const basegfx::B2IPoint aDestLeftBottom(0,5);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "cppunit/extensions/HelperMacros.h" #include "cppunit/extensions/HelperMacros.h"
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
...@@ -191,7 +191,7 @@ private: ...@@ -191,7 +191,7 @@ private:
BitmapDeviceSharedPtr pClippedDevice( BitmapDeviceSharedPtr pClippedDevice(
subsetBitmapDevice( rDevice, subsetBitmapDevice( rDevice,
basegfx::B2IRange(3,3,5,8) )); basegfx::B2IBox(3,3,5,8) ));
rDevice->clear(aBgCol); rDevice->clear(aBgCol);
pClippedDevice->fillPolyPolygon( pClippedDevice->fillPolyPolygon(
......
...@@ -70,6 +70,7 @@ namespace basegfx ...@@ -70,6 +70,7 @@ namespace basegfx
class B2DPoint; class B2DPoint;
class B2DRange; class B2DRange;
class B3DRange; class B3DRange;
class B2IBox;
class B2IVector; class B2IVector;
class B2IPoint; class B2IPoint;
class B2IRange; class B2IRange;
...@@ -206,6 +207,19 @@ namespace basegfx ...@@ -206,6 +207,19 @@ namespace basegfx
*/ */
BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange ); BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
/** Return smalltest integer box, which completely contains
given floating point range.
@param rRange
Input range. Values must be within the representable
bounds of sal_Int32
@return the closest integer box, which completely contains
rRange. Note that this box will contain all pixel affected
by a polygon fill operation over the input range.
*/
BASEGFX_DLLPUBLIC ::basegfx::B2IBox b2ISurroundingBoxFromB2DRange( const ::basegfx::B2DRange& rRange );
/** Return smalltest B2DRange with integer values, which /** Return smalltest B2DRange with integer values, which
completely contains given floating point range. completely contains given floating point range.
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/point/b2ipoint.hxx> #include <basegfx/point/b2ipoint.hxx>
#include <basegfx/range/b2irectangle.hxx> #include <basegfx/range/b2irectangle.hxx>
#include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/tools/canvastools.hxx> #include <basegfx/tools/canvastools.hxx>
...@@ -597,6 +598,14 @@ namespace basegfx ...@@ -597,6 +598,14 @@ namespace basegfx
rRect.Y + rRect.Height ); rRect.Y + rRect.Height );
} }
::basegfx::B2IBox b2ISurroundingBoxFromB2DRange( const ::basegfx::B2DRange& rRange )
{
return ::basegfx::B2IBox( static_cast<sal_Int32>( floor(rRange.getMinX()) ),
static_cast<sal_Int32>( floor(rRange.getMinY()) ),
static_cast<sal_Int32>( ceil(rRange.getMaxX()) ),
static_cast<sal_Int32>( ceil(rRange.getMaxY()) ) );
}
::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange ) ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange )
{ {
return ::basegfx::B2IRange( static_cast<sal_Int32>( floor(rRange.getMinX()) ), return ::basegfx::B2IRange( static_cast<sal_Int32>( floor(rRange.getMinX()) ),
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "headless/svpbmp.hxx" #include "headless/svpbmp.hxx"
#include <basegfx/vector/b2ivector.hxx> #include <basegfx/vector/b2ivector.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basebmp/scanlineformats.hxx> #include <basebmp/scanlineformats.hxx>
#include <basebmp/color.hxx> #include <basebmp/color.hxx>
...@@ -96,7 +96,7 @@ bool SvpSalBitmap::Create( const SalBitmap& rSalBmp ) ...@@ -96,7 +96,7 @@ bool SvpSalBitmap::Create( const SalBitmap& rSalBmp )
{ {
B2IVector aSize = rSrcBmp->getSize(); B2IVector aSize = rSrcBmp->getSize();
m_aBitmap = cloneBitmapDevice( aSize, rSrcBmp ); 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 ); m_aBitmap->drawBitmap( rSrcBmp, aRect, aRect, DrawMode_PAINT );
} }
else else
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <vcl/sysdata.hxx> #include <vcl/sysdata.hxx>
#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
...@@ -199,7 +199,7 @@ SvpSalGraphics::ClipUndoHandle::~ClipUndoHandle() ...@@ -199,7 +199,7 @@ SvpSalGraphics::ClipUndoHandle::~ClipUndoHandle()
// will avoid setting up the clip bitmap. Similarly if the // will avoid setting up the clip bitmap. Similarly if the
// range doesn't appear at all we return true to avoid // range doesn't appear at all we return true to avoid
// rendering // rendering
bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGraphics::ClipUndoHandle &rUndo ) bool SvpSalGraphics::isClippedSetup( const basegfx::B2IBox &aRange, SvpSalGraphics::ClipUndoHandle &rUndo )
{ {
if( m_bClipSetup ) if( m_bClipSetup )
return false; return false;
...@@ -244,10 +244,10 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGrap ...@@ -244,10 +244,10 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGrap
// fprintf (stderr, " operation only overlaps with a single clip zone\n" ); // fprintf (stderr, " operation only overlaps with a single clip zone\n" );
rUndo.m_aDevice = m_aDevice; rUndo.m_aDevice = m_aDevice;
m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
basegfx::B2IRange (aHitRect.Left(), basegfx::B2IBox (aHitRect.Left(),
aHitRect.Top(), aHitRect.Top(),
aHitRect.Right(), aHitRect.Right(),
aHitRect.Bottom()) ); aHitRect.Bottom()) );
return false; return false;
} }
// fprintf (stderr, "URK: complex & slow clipping case\n" ); // fprintf (stderr, "URK: complex & slow clipping case\n" );
...@@ -281,7 +281,7 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip ) ...@@ -281,7 +281,7 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
m_aClipMap.reset(); m_aClipMap.reset();
Rectangle aBoundRect( i_rClip.GetBoundRect() ); Rectangle aBoundRect( i_rClip.GetBoundRect() );
m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice, 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; m_bClipSetup = true;
} }
else else
...@@ -531,8 +531,8 @@ void SvpSalGraphics::copyArea( long nDestX, ...@@ -531,8 +531,8 @@ void SvpSalGraphics::copyArea( long nDestX,
long nSrcHeight, long nSrcHeight,
sal_uInt16 /*nFlags*/ ) sal_uInt16 /*nFlags*/ )
{ {
B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight ); B2IBox aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight ); B2IBox aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
// fprintf( stderr, "copyArea %ld pixels - clip region %d\n", // fprintf( stderr, "copyArea %ld pixels - clip region %d\n",
// (long)(nSrcWidth * nSrcHeight), m_aClipMap.get() != NULL ); // (long)(nSrcWidth * nSrcHeight), m_aClipMap.get() != NULL );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
...@@ -546,12 +546,12 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry, ...@@ -546,12 +546,12 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
{ {
SvpSalGraphics* pSrc = pSrcGraphics ? SvpSalGraphics* pSrc = pSrcGraphics ?
static_cast<SvpSalGraphics*>(pSrcGraphics) : this; static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcX+pPosAry->mnSrcWidth, pPosAry->mnSrcX+pPosAry->mnSrcWidth,
pPosAry->mnSrcY+pPosAry->mnSrcHeight ); pPosAry->mnSrcY+pPosAry->mnSrcHeight );
B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
pPosAry->mnDestX+pPosAry->mnDestWidth, pPosAry->mnDestX+pPosAry->mnDestWidth,
pPosAry->mnDestY+pPosAry->mnDestHeight ); pPosAry->mnDestY+pPosAry->mnDestHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRect, aUndo ) ) if( !isClippedSetup( aDestRect, aUndo ) )
...@@ -563,12 +563,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry, ...@@ -563,12 +563,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap ) const SalBitmap& rSalBitmap )
{ {
const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcX+pPosAry->mnSrcWidth, pPosAry->mnSrcX+pPosAry->mnSrcWidth,
pPosAry->mnSrcY+pPosAry->mnSrcHeight ); pPosAry->mnSrcY+pPosAry->mnSrcHeight );
B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
pPosAry->mnDestX+pPosAry->mnDestWidth, pPosAry->mnDestX+pPosAry->mnDestWidth,
pPosAry->mnDestY+pPosAry->mnDestHeight ); pPosAry->mnDestY+pPosAry->mnDestHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRect, aUndo ) ) if( !isClippedSetup( aDestRect, aUndo ) )
...@@ -589,12 +589,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry, ...@@ -589,12 +589,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
{ {
const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap); const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap);
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcX+pPosAry->mnSrcWidth, pPosAry->mnSrcX+pPosAry->mnSrcWidth,
pPosAry->mnSrcY+pPosAry->mnSrcHeight ); pPosAry->mnSrcY+pPosAry->mnSrcHeight );
B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY, B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
pPosAry->mnDestX+pPosAry->mnDestWidth, pPosAry->mnDestX+pPosAry->mnDestWidth,
pPosAry->mnDestY+pPosAry->mnDestHeight ); pPosAry->mnDestY+pPosAry->mnDestHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRect, aUndo ) ) if( !isClippedSetup( aDestRect, aUndo ) )
m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(), m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(),
...@@ -607,9 +607,9 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry, ...@@ -607,9 +607,9 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
SalColor nMaskColor ) SalColor nMaskColor )
{ {
const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap); const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY, B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcX+pPosAry->mnSrcWidth, pPosAry->mnSrcX+pPosAry->mnSrcWidth,
pPosAry->mnSrcY+pPosAry->mnSrcHeight ); pPosAry->mnSrcY+pPosAry->mnSrcHeight );
B2IPoint aDestPoint( pPosAry->mnDestX, pPosAry->mnDestY ); B2IPoint aDestPoint( pPosAry->mnDestX, pPosAry->mnDestY );
// BitmapDevice::drawMaskedColor works with 0==transparent, // BitmapDevice::drawMaskedColor works with 0==transparent,
...@@ -624,8 +624,8 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry, ...@@ -624,8 +624,8 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() ); aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() );
basebmp::Color aColor( nMaskColor ); basebmp::Color aColor( nMaskColor );
B2IRange aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ); B2IBox aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight );
const B2IRange aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) ); const B2IBox aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aClipRect, aUndo ) ) if( !isClippedSetup( aClipRect, aUndo ) )
...@@ -638,8 +638,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh ...@@ -638,8 +638,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
BitmapDeviceSharedPtr aCopy = BitmapDeviceSharedPtr aCopy =
cloneBitmapDevice( B2IVector( nWidth, nHeight ), cloneBitmapDevice( B2IVector( nWidth, nHeight ),
m_aDevice ); m_aDevice );
B2IRange aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight );
B2IRange aDestRect( 0, 0, nWidth, nHeight ); B2IBox aDestRect( 0, 0, nWidth, nHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRect, aUndo ) ) if( !isClippedSetup( aDestRect, aUndo ) )
...@@ -661,7 +661,7 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv ...@@ -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 // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME
B2DPolygon aRect = tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); B2DPolygon aRect = tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) );
B2DPolyPolygon aPolyPoly( aRect ); B2DPolyPolygon aPolyPoly( aRect );
B2IRange aDestRange( nX, nY, nX + nWidth, nY + nHeight ); B2IBox aDestRange( nX, nY, nX + nWidth, nY + nHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRange, aUndo ) ) if( !isClippedSetup( aDestRange, aUndo ) )
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
************************************************************************/ ************************************************************************/
#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basebmp/scanlineformats.hxx> #include <basebmp/scanlineformats.hxx>
...@@ -532,8 +532,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) ...@@ -532,8 +532,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
continue; continue;
// blend text color into target using the glyph's mask // blend text color into target using the glyph's mask
const B2IRange aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() ); const B2IBox aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() );
const B2IRange aClipRect( aDstPoint, aAlphaMask->getSize() ); const B2IBox aClipRect( aDstPoint, aAlphaMask->getSize() );
SvpSalGraphics::ClipUndoHandle aUndo( this ); SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aClipRect, aUndo ) ) if( !isClippedSetup( aClipRect, aUndo ) )
......
...@@ -66,7 +66,7 @@ private: ...@@ -66,7 +66,7 @@ private:
ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {} ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {}
~ClipUndoHandle(); ~ClipUndoHandle();
}; };
bool isClippedSetup( const basegfx::B2IRange &aRange, ClipUndoHandle &rUndo ); bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo );
void ensureClip(); void ensureClip();
protected: protected:
......
...@@ -432,7 +432,7 @@ public: ...@@ -432,7 +432,7 @@ public:
static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); 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() #define OOO_TYPE_FIXED ooo_fixed_get_type()
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <svids.hrc> #include <svids.hrc>
#include <sal/macros.h> #include <sal/macros.h>
#include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2ibox.hxx>
#include <basegfx/vector/b2ivector.hxx> #include <basegfx/vector/b2ivector.hxx>
#include <algorithm> #include <algorithm>
...@@ -352,7 +352,7 @@ struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker ...@@ -352,7 +352,7 @@ struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker
{ {
DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame) 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); m_rFrame.damaged(rDamageRect);
} }
...@@ -3014,7 +3014,7 @@ void GtkSalFrame::popIgnoreDamage() ...@@ -3014,7 +3014,7 @@ void GtkSalFrame::popIgnoreDamage()
#endif #endif
} }
void GtkSalFrame::damaged (const basegfx::B2IRange& rDamageRect) void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
{ {
#if !GTK_CHECK_VERSION(3,0,0) #if !GTK_CHECK_VERSION(3,0,0)
(void)rDamageRect; (void)rDamageRect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment