summaryrefslogtreecommitdiff
path: root/canvas/source/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'canvas/source/vcl')
-rw-r--r--canvas/source/vcl/backbuffer.cxx2
-rw-r--r--canvas/source/vcl/bitmapbackbuffer.cxx8
-rw-r--r--canvas/source/vcl/canvasbitmap.cxx2
-rw-r--r--canvas/source/vcl/canvasbitmaphelper.cxx12
-rw-r--r--canvas/source/vcl/canvasfont.cxx4
-rw-r--r--canvas/source/vcl/canvashelper.cxx54
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx50
-rw-r--r--canvas/source/vcl/devicehelper.cxx2
-rw-r--r--canvas/source/vcl/exports.dxp1
-rw-r--r--canvas/source/vcl/impltools.cxx18
-rw-r--r--canvas/source/vcl/impltools.hxx2
-rw-r--r--canvas/source/vcl/makefile.mk8
-rw-r--r--canvas/source/vcl/spritecanvashelper.cxx10
-rw-r--r--canvas/source/vcl/spritedevicehelper.cxx4
-rwxr-xr-x[-rw-r--r--]canvas/source/vcl/spritehelper.cxx21
-rw-r--r--canvas/source/vcl/textlayout.cxx28
-rw-r--r--canvas/source/vcl/vclcanvas.component37
17 files changed, 149 insertions, 114 deletions
diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx
index ea99b371a483..0cb4556fb851 100644
--- a/canvas/source/vcl/backbuffer.cxx
+++ b/canvas/source/vcl/backbuffer.cxx
@@ -49,7 +49,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx
index 6865a70f1e31..37130b575dc1 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -89,7 +89,7 @@ namespace vclcanvas
if( mbVDevContentIsCurrent && mpVDev )
{
// VDev content is more current than bitmap - copy contents before!
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
const Point aEmptyPoint;
*maBitmap = mpVDev->GetBitmapEx( aEmptyPoint,
mpVDev->GetOutputSizePixel() );
@@ -109,7 +109,7 @@ namespace vclcanvas
if( mbVDevContentIsCurrent && mpVDev )
{
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
aSize = mpVDev->GetOutputSizePixel();
}
@@ -139,7 +139,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
@@ -152,7 +152,7 @@ namespace vclcanvas
if( mpVDev && mbBitmapContentIsCurrent )
{
// fill with bitmap content
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
const Point aEmptyPoint;
mpVDev->DrawBitmapEx( aEmptyPoint, *maBitmap );
}
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index 300617f417eb..1f8840afc264 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -50,7 +50,7 @@ namespace vclcanvas
{
// create bitmap for given reference device
// ========================================
- const USHORT nBitCount( (USHORT)24U );
+ const sal_uInt16 nBitCount( (sal_uInt16)24U );
const BitmapPalette* pPalette = NULL;
Bitmap aBitmap( rSize, nBitCount, pPalette );
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index 39ee411bf34c..38dcc9e844e8 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -267,7 +267,7 @@ namespace vclcanvas
x<aBmpSize.Width() && x<rect.X2;
++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
@@ -275,7 +275,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -297,7 +297,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -319,7 +319,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -339,7 +339,7 @@ namespace vclcanvas
// cast to unsigned byte, for correct subtraction result
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
- static_cast<BYTE>(255 -
+ static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ])) ) );
}
}
@@ -360,7 +360,7 @@ namespace vclcanvas
x<aBmpSize.Width() && x<rect.X2;
++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 71962cf3b45c..4d1cb2b087c3 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -61,7 +61,7 @@ namespace vclcanvas
{
maFont->SetAlign( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
- maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
// TODO(F2): improve panose->vclenum conversion
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
@@ -78,7 +78,7 @@ namespace vclcanvas
OutputDevice& rOutDev( rOutDevProvider->getOutDev() );
const bool bOldMapState( rOutDev.IsMapModeEnabled() );
- rOutDev.EnableMapMode(FALSE);
+ rOutDev.EnableMapMode(sal_False);
const Size aSize = rOutDev.GetFontMetric( *maFont ).GetSize();
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 7ae02c7c3492..6fb918df8f1c 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -145,7 +145,7 @@ namespace vclcanvas
void CanvasHelper::setBackgroundOutDev( const OutDevProviderSharedPtr& rOutDev )
{
mp2ndOutDev = rOutDev;
- mp2ndOutDev->getOutDev().EnableMapMode( FALSE );
+ mp2ndOutDev->getOutDev().EnableMapMode( sal_False );
}
void CanvasHelper::clear()
@@ -156,7 +156,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetLineColor( COL_TRANSPARENT );
rOutDev.SetFillColor( COL_TRANSPARENT );
rOutDev.DrawRect( Rectangle( Point(),
@@ -167,7 +167,7 @@ namespace vclcanvas
OutputDevice& rOutDev2( mp2ndOutDev->getOutDev() );
rOutDev2.SetDrawMode( DRAWMODE_DEFAULT );
- rOutDev2.EnableMapMode( FALSE );
+ rOutDev2.EnableMapMode( sal_False );
rOutDev2.SetLineColor( COL_TRANSPARENT );
rOutDev2.SetFillColor( COL_TRANSPARENT );
rOutDev2.DrawRect( Rectangle( Point(),
@@ -298,9 +298,9 @@ namespace vclcanvas
// DrawPolygon(), and open ones via DrawPolyLine():
// closed polygons will simply already contain the
// closing segment.
- USHORT nSize( aPolyPoly.Count() );
+ sal_uInt16 nSize( aPolyPoly.Count() );
- for( USHORT i=0; i<nSize; ++i )
+ for( sal_uInt16 i=0; i<nSize; ++i )
{
mpOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] );
@@ -410,21 +410,21 @@ namespace vclcanvas
// self-intersections. Therefore, if we would render it
// via OutDev::DrawPolyPolygon(), on/off fill would
// generate off areas on those self-intersections.
- USHORT nSize( aVCLPolyPoly.Count() );
+ sal_uInt16 nSize( aVCLPolyPoly.Count() );
- for( USHORT i=0; i<nSize; ++i )
+ for( sal_uInt16 i=0; i<nSize; ++i )
{
if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) {
mpOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
} else {
- const USHORT nPolySize = aVCLPolyPoly[i].GetSize();
+ const sal_uInt16 nPolySize = aVCLPolyPoly[i].GetSize();
if( nPolySize ) {
Point rPrevPoint = aVCLPolyPoly[i].GetPoint( 0 );
Point rPoint;
- for( USHORT j=1; j<nPolySize; j++ ) {
+ for( sal_uInt16 j=1; j<nPolySize; j++ ) {
rPoint = aVCLPolyPoly[i].GetPoint( j );
mpOutDev->getOutDev().DrawLine( rPrevPoint, rPoint );
if( mp2ndOutDev )
@@ -497,7 +497,7 @@ namespace vclcanvas
}
else
{
- mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (USHORT)nTransPercent );
+ mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
if( mp2ndOutDev )
@@ -522,7 +522,7 @@ namespace vclcanvas
}
else
{
- mp2ndOutDev->getOutDev().DrawTransparent( aPolyPoly, (USHORT)nTransPercent );
+ mp2ndOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
}
}
@@ -584,7 +584,7 @@ namespace vclcanvas
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// change text direction and layout mode
- ULONG nLayoutMode(0);
+ sal_uIntPtr nLayoutMode(0);
switch( textDirection )
{
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
@@ -608,16 +608,16 @@ namespace vclcanvas
mpOutDev->getOutDev().SetLayoutMode( nLayoutMode );
mpOutDev->getOutDev().DrawText( aOutpos,
text.Text,
- ::canvas::tools::numeric_cast<USHORT>(text.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(text.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
if( mp2ndOutDev )
{
mp2ndOutDev->getOutDev().SetLayoutMode( nLayoutMode );
mp2ndOutDev->getOutDev().DrawText( aOutpos,
text.Text,
- ::canvas::tools::numeric_cast<USHORT>(text.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(text.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
}
}
@@ -760,7 +760,7 @@ namespace vclcanvas
// equivalent to the origAlpha*modulateAlpha the
// DX canvas performs)
aGrfAttr.SetTransparency(
- static_cast< BYTE >(
+ static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - nAlphaModulation ) ) ) );
}
@@ -779,7 +779,7 @@ namespace vclcanvas
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
- aGrfAttr.SetRotation( static_cast< USHORT >(::basegfx::fround(nAngleInTenthOfDegrees)) );
+ aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj.reset( new GraphicObject( aBmpEx ) );
}
@@ -914,7 +914,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
// TODO(F2): Support alpha vdev canvas here
const Point aEmptyPoint(0,0);
@@ -943,7 +943,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(),
aRect.GetSize()) );
@@ -996,11 +996,11 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
- const USHORT nBitCount( ::std::min( (USHORT)24U,
- (USHORT)rOutDev.GetBitCount() ) );
+ const sal_uInt16 nBitCount( ::std::min( (sal_uInt16)24U,
+ (sal_uInt16)rOutDev.GetBitCount() ) );
const BitmapPalette* pPalette = NULL;
if( nBitCount <= 8 )
@@ -1046,7 +1046,7 @@ namespace vclcanvas
for( x=0; x<nWidth; ++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
@@ -1122,7 +1122,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1159,7 +1159,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1198,7 +1198,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
OutputDevice* p2ndOutDev = NULL;
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
if( mp2ndOutDev )
p2ndOutDev = &mp2ndOutDev->getOutDev();
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 4d08f873deb1..e7ffe0e41356 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -89,7 +89,7 @@ namespace vclcanvas
const ::Size& rTileSize,
const GraphicAttr& rAttr)
{
- BOOL bRet( false );
+ bool bRet( false );
Point aCurrPos;
int nX, nY;
@@ -102,10 +102,10 @@ namespace vclcanvas
{
// update return value. This method should return true, if
// at least one of the looped Draws succeeded.
- bRet |= rGraphic.Draw( &rOutDev,
+ bRet |= ( sal_True == rGraphic.Draw( &rOutDev,
aCurrPos,
rTileSize,
- &rAttr );
+ &rAttr ) );
aCurrPos.X() += rNextTileX.Width();
aCurrPos.Y() += rNextTileX.Height();
@@ -179,7 +179,7 @@ namespace vclcanvas
// vertex values in the loop below (as ::Polygon is a
// pimpl class, creating one every loop turn would really
// stress the mem allocator)
- ::Polygon aTempPoly( static_cast<USHORT>(5) );
+ ::Polygon aTempPoly( static_cast<sal_uInt16>(5) );
OSL_ENSURE( nStepCount >= 3,
"fillLinearGradient(): stepcount smaller than 3" );
@@ -212,6 +212,8 @@ namespace vclcanvas
if( (rColors.size() % 2) != (nStepCount % 2) )
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
// only iterate nStepCount-1 steps, as the last strip is
@@ -223,9 +225,9 @@ namespace vclcanvas
boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(double(i)/nStepCount);
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
// copy right egde of polygon to left edge (and also
// copy the closing point)
@@ -349,7 +351,7 @@ namespace vclcanvas
const sal_uInt32 nNumPoints( aOuterPoly.count() );
- ::Polygon aTempPoly( static_cast<USHORT>(nNumPoints+1) );
+ ::Polygon aTempPoly( static_cast<sal_uInt16>(nNumPoints+1) );
// increase number of steps by one: polygonal gradients have
// the outermost polygon rendered in rColor2, and the
@@ -367,6 +369,8 @@ namespace vclcanvas
// color).
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
if( !bFillNonOverlapping )
@@ -388,9 +392,9 @@ namespace vclcanvas
// lerp color
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
// scale and render polygon, by interpolating between
// outer and inner polygon.
@@ -400,13 +404,13 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
- aTempPoly[(USHORT)p] = ::Point(
+ aTempPoly[(sal_uInt16)p] = ::Point(
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
}
// close polygon explicitely
- aTempPoly[(USHORT)p] = aTempPoly[0];
+ aTempPoly[(sal_uInt16)p] = aTempPoly[0];
// TODO(P1): compare with vcl/source/gdi/outdev4.cxx,
// OutputDevice::ImplDrawComplexGradient(), there's a note
@@ -425,7 +429,7 @@ namespace vclcanvas
// in the loop below (as ::Polygon is a pimpl class, creating
// one every loop turn would really stress the mem allocator)
::PolyPolygon aTempPolyPoly;
- ::Polygon aTempPoly2( static_cast<USHORT>(nNumPoints+1) );
+ ::Polygon aTempPoly2( static_cast<sal_uInt16>(nNumPoints+1) );
aTempPoly2[0] = rBounds.TopLeft();
aTempPoly2[1] = rBounds.TopRight();
@@ -446,9 +450,9 @@ namespace vclcanvas
// lerp color
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
if( i && !(i % 10) )
@@ -464,13 +468,13 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
- aTempPoly[(USHORT)p] = ::Point(
+ aTempPoly[(sal_uInt16)p] = ::Point(
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
}
// close polygon explicitely
- aTempPoly[(USHORT)p] = aTempPoly[0];
+ aTempPoly[(sal_uInt16)p] = aTempPoly[0];
// swap inner and outer polygon
aTempPolyPoly.Replace( aTempPolyPoly.GetObject( 1 ), 0 );
@@ -701,7 +705,7 @@ namespace vclcanvas
}
#endif // complex-clipping vs. XOR-trick
-#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
+#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{
::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
::basegfx::B2DRectangle aTextureDeviceRect;
@@ -922,7 +926,7 @@ namespace vclcanvas
aGrfAttr.SetMirrorFlags(
( aScale.getX() < 0.0 ? BMP_MIRROR_HORZ : 0 ) |
( aScale.getY() < 0.0 ? BMP_MIRROR_VERT : 0 ) );
- aGrfAttr.SetRotation( static_cast< USHORT >(::basegfx::fround( nRotate*10.0 )) );
+ aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround( nRotate*10.0 )) );
pGrfObj.reset( new GraphicObject( aBmpEx ) );
}
@@ -1051,7 +1055,7 @@ namespace vclcanvas
// equivalent to the origAlpha*modulateAlpha
// the DX canvas performs)
aGrfAttr.SetTransparency(
- static_cast< BYTE >(
+ static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
}
@@ -1122,7 +1126,7 @@ namespace vclcanvas
aVDev.GetBitmap( aEmptyPoint,
aVDev.GetOutputSizePixel() ) );
- BYTE nCol( static_cast< BYTE >(
+ sal_uInt8 nCol( static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
AlphaMask aAlpha( aVDev.GetOutputSizePixel(),
&nCol );
diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx
index 02c4e547be76..96b14e2cfb73 100644
--- a/canvas/source/vcl/devicehelper.cxx
+++ b/canvas/source/vcl/devicehelper.cxx
@@ -231,7 +231,7 @@ namespace vclcanvas
const ::Point aEmptyPoint;
OutputDevice& rOutDev = mpOutDev->getOutDev();
bool bOldMap( rOutDev.IsMapModeEnabled() );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
aStream << rOutDev.GetBitmap(aEmptyPoint,
rOutDev.GetOutputSizePixel());
rOutDev.EnableMapMode( bOldMap );
diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/canvas/source/vcl/exports.dxp
+++ b/canvas/source/vcl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index a6cfe4a0a7f1..24f32aadc237 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -180,7 +180,7 @@ namespace vclcanvas
const ::Polygon& rPoly( rPolyPoly[0] );
- USHORT nCount( rPoly.GetSize() );
+ sal_uInt16 nCount( rPoly.GetSize() );
if( nCount < 4 )
return false;
@@ -391,7 +391,7 @@ namespace vclcanvas
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
255U -
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nAlphaModulation*
(255U
- aAlphaMap[ pAlphaReadAccess->GetPixel(
@@ -402,15 +402,15 @@ namespace vclcanvas
nSrcX ) );
aColor.SetRed(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nRedModulation *
aColor.GetRed() + .5 ));
aColor.SetGreen(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nGreenModulation *
aColor.GetGreen() + .5 ));
aColor.SetBlue(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nBlueModulation *
aColor.GetBlue() + .5 ));
@@ -445,7 +445,7 @@ namespace vclcanvas
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
255U -
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nAlphaModulation*255.0
+ .5 ) ) );
@@ -453,15 +453,15 @@ namespace vclcanvas
nSrcX ) );
aColor.SetRed(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nRedModulation *
aColor.GetRed() + .5 ));
aColor.SetGreen(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nGreenModulation *
aColor.GetGreen() + .5 ));
aColor.SetBlue(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nBlueModulation *
aColor.GetBlue() + .5 ));
diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx
index 963162b22587..8b9293acb44d 100644
--- a/canvas/source/vcl/impltools.hxx
+++ b/canvas/source/vcl/impltools.hxx
@@ -170,7 +170,7 @@ namespace vclcanvas
if( mpOutDev )
{
mpOutDev->Push();
- mpOutDev->EnableMapMode(FALSE);
+ mpOutDev->EnableMapMode(sal_False);
}
}
diff --git a/canvas/source/vcl/makefile.mk b/canvas/source/vcl/makefile.mk
index be2fc69894a4..7d5f9658c829 100644
--- a/canvas/source/vcl/makefile.mk
+++ b/canvas/source/vcl/makefile.mk
@@ -83,3 +83,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/vclcanvas.component
+
+$(MISC)/vclcanvas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vclcanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vclcanvas.component
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index 29c6725a70af..ac75508809fe 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -99,7 +99,7 @@ namespace vclcanvas
// clip output to actual update region (otherwise a)
// wouldn't save much render time, and b) will clutter
// scrolled sprite content outside this area)
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetClipRegion( rRequestedArea );
// repaint affected sprite directly to output device (at
@@ -319,7 +319,7 @@ namespace vclcanvas
// but repaint everything (or caller requested that)
maVDev->SetOutputSizePixel( aOutDevSize );
- maVDev->EnableMapMode( FALSE );
+ maVDev->EnableMapMode( sal_False );
maVDev->DrawOutDev( aEmptyPoint, aOutDevSize,
aEmptyPoint, aOutDevSize,
rBackOutDev );
@@ -333,7 +333,7 @@ namespace vclcanvas
_1 ) );
// flush to screen
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetClipRegion();
rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize,
aEmptyPoint, aOutDevSize,
@@ -578,7 +578,7 @@ namespace vclcanvas
}
// paint background
- maVDev->EnableMapMode( FALSE );
+ maVDev->EnableMapMode( sal_False );
maVDev->SetClipRegion();
maVDev->DrawOutDev( aEmptyPoint, aOutputSize,
aOutputPosition, aOutputSize,
@@ -595,7 +595,7 @@ namespace vclcanvas
_1 ) );
// flush to screen
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.DrawOutDev( aOutputPosition, aOutputSize,
aEmptyPoint, aOutputSize,
*maVDev );
diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx
index c11adbd7abc0..88f473e3158f 100644
--- a/canvas/source/vcl/spritedevicehelper.cxx
+++ b/canvas/source/vcl/spritedevicehelper.cxx
@@ -68,7 +68,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
@@ -148,7 +148,7 @@ namespace vclcanvas
SvFileStream aStream( aFilename, STREAM_STD_READWRITE );
const ::Point aEmptyPoint;
- mpBackBuffer->getOutDev().EnableMapMode( FALSE );
+ mpBackBuffer->getOutDev().EnableMapMode( sal_False );
aStream << mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint,
mpBackBuffer->getOutDev().GetOutputSizePixel());
}
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 2fa8a6d441c4..21e59a566488 100644..100755
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -342,21 +342,8 @@ namespace vclcanvas
else
#endif
{
- // redraw is direcly on the front buffer,
- // or using alpha blending - cannot use
- // XOR, thus, employing the still somewhat
- // speedier triangle clip method
- ::basegfx::B2DPolygon aTriangulatedClip(::basegfx::triangulator::triangulate(aClipPoly));
-
- // restrict the clipping area to the visible portion of the output device.
- Size aSize(rTargetSurface.GetOutputSizePixel());
- ::basegfx::B2DRange aOutputRect(::basegfx::B2DPoint(0,0),::basegfx::B2DPoint(aSize.Width(),aSize.Height()));
- ::basegfx::B2DPolygon aClippedClip(::basegfx::tools::clipTriangleListOnRange(aTriangulatedClip,aOutputRect));
-
- // #i76339#
- const Polygon aPoly(aClippedClip);
- const PolyPolygon aPolyPoly(aPoly);
- rTargetSurface.SetTriangleClipRegion(aPolyPoly);
+ Region aClipRegion( aClipPoly );
+ rTargetSurface.SetClipRegion( aClipRegion );
}
}
}
@@ -377,7 +364,7 @@ namespace vclcanvas
// here
// draw semi-transparent
- BYTE nColor( static_cast<UINT8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
+ sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
AlphaMask aAlpha( maContent->GetSizePixel(),
&nColor );
@@ -409,7 +396,7 @@ namespace vclcanvas
for( int i=0; i<aMarkerPoly.Count(); ++i )
{
- rTargetSurface.DrawPolyLine( aMarkerPoly.GetObject((USHORT)i) );
+ rTargetSurface.DrawPolyLine( aMarkerPoly.GetObject((sal_uInt16)i) );
}
// paint sprite prio
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index ffd650dcd0bb..08cdd66abe00 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -59,7 +59,7 @@ namespace vclcanvas
sal_Int8 nTextDirection )
{
// TODO(P3): avoid if already correctly set
- ULONG nLayoutMode;
+ sal_uIntPtr nLayoutMode;
switch( nTextDirection )
{
default:
@@ -140,10 +140,10 @@ namespace vclcanvas
if (aVDev.GetTextOutlines(
aOutlines,
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length),
- FALSE,
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
+ sal_False,
0,
aOffsets.get()))
{
@@ -193,9 +193,9 @@ namespace vclcanvas
if (aVDev.GetGlyphBoundRects(
Point(0,0),
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
aMetricVector))
{
aBoundingBoxes.realloc(aMetricVector.size());
@@ -273,8 +273,8 @@ namespace vclcanvas
return geometry::RealRectangle2D( 0, nAboveBaseline,
aVDev.GetTextWidth(
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) ),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
nBelowBaseline );
}
}
@@ -406,15 +406,15 @@ namespace vclcanvas
rOutDev.DrawTextArray( rOutpos,
maText.Text,
aOffsets.get(),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
else
{
rOutDev.DrawText( rOutpos,
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
return true;
diff --git a/canvas/source/vcl/vclcanvas.component b/canvas/source/vcl/vclcanvas.component
new file mode 100644
index 000000000000..f7e0bb8c0266
--- /dev/null
+++ b/canvas/source/vcl/vclcanvas.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.Canvas.VCL">
+ <service name="com.sun.star.rendering.Canvas.VCL"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.VCL">
+ <service name="com.sun.star.rendering.SpriteCanvas.VCL"/>
+ </implementation>
+</component>