You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/01/23 15:27:51 UTC
svn commit: r1437407 [1/3] - in /openoffice/trunk: ./
main/canvas/source/vcl/ main/drawinglayer/
main/drawinglayer/source/processor2d/
main/officecfg/registry/schema/org/openoffice/Office/
main/svx/source/sdr/contact/ main/svx/source/svdraw/ main/vcl/a...
Author: alg
Date: Wed Jan 23 14:27:50 2013
New Revision: 1437407
URL: http://svn.apache.org/viewvc?rev=1437407&view=rev
Log:
#121534# Reintegrating changes for rotated bitmap support
Removed:
openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.hxx
openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx
openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx
Modified:
openoffice/trunk/ (props changed)
openoffice/trunk/main/canvas/source/vcl/bitmapbackbuffer.cxx
openoffice/trunk/main/canvas/source/vcl/canvashelper.cxx
openoffice/trunk/main/canvas/source/vcl/impltools.hxx
openoffice/trunk/main/canvas/source/vcl/spritecanvashelper.cxx
openoffice/trunk/main/canvas/source/vcl/spritedevicehelper.cxx
openoffice/trunk/main/drawinglayer/Library_drawinglayer.mk
openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
openoffice/trunk/main/svx/source/sdr/contact/objectcontactofpageview.cxx
openoffice/trunk/main/svx/source/svdraw/svdhdl.cxx
openoffice/trunk/main/svx/source/svdraw/svdograf.cxx
openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx
openoffice/trunk/main/vcl/inc/aqua/salgdi.h
openoffice/trunk/main/vcl/inc/os2/salgdi.h
openoffice/trunk/main/vcl/inc/salgdi.hxx
openoffice/trunk/main/vcl/inc/unx/gtk/gtkgdi.hxx
openoffice/trunk/main/vcl/inc/unx/pspgraphics.h
openoffice/trunk/main/vcl/inc/unx/salgdi.h
openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx
openoffice/trunk/main/vcl/inc/vcl/outdev.hxx
openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx
openoffice/trunk/main/vcl/inc/win/salbmp.h
openoffice/trunk/main/vcl/inc/win/salgdi.h
openoffice/trunk/main/vcl/inc/win/salvd.h
openoffice/trunk/main/vcl/os2/source/gdi/salgdi2.cxx
openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx
openoffice/trunk/main/vcl/source/gdi/outdev2.cxx
openoffice/trunk/main/vcl/source/gdi/outmap.cxx
openoffice/trunk/main/vcl/source/gdi/salgdilayout.cxx
openoffice/trunk/main/vcl/source/gdi/salmisc.cxx
openoffice/trunk/main/vcl/source/gdi/virdev.cxx
openoffice/trunk/main/vcl/unx/generic/gdi/pspgraphics.cxx
openoffice/trunk/main/vcl/unx/generic/gdi/salgdi2.cxx
openoffice/trunk/main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
openoffice/trunk/main/vcl/unx/headless/svpgdi.cxx
openoffice/trunk/main/vcl/unx/headless/svpgdi.hxx
openoffice/trunk/main/vcl/unx/headless/svppspgraphics.cxx
openoffice/trunk/main/vcl/unx/headless/svppspgraphics.hxx
openoffice/trunk/main/vcl/win/source/gdi/salbmp.cxx
openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx
openoffice/trunk/main/vcl/win/source/gdi/salgdi2.cxx
openoffice/trunk/main/vcl/win/source/gdi/salgdi3.cxx
openoffice/trunk/main/vcl/win/source/gdi/salgdi_gdiplus.cxx
openoffice/trunk/main/vcl/win/source/gdi/salnativewidgets-luna.cxx
openoffice/trunk/main/vcl/win/source/gdi/salprn.cxx
openoffice/trunk/main/vcl/win/source/gdi/salvd.cxx
openoffice/trunk/main/vcl/win/source/gdi/winlayout.cxx
openoffice/trunk/main/vcl/win/source/window/salframe.cxx
openoffice/trunk/test/ (props changed)
openoffice/trunk/test/testcommon/source/org/openoffice/test/vcl/ (props changed)
Propchange: openoffice/trunk/
------------------------------------------------------------------------------
Merged /openoffice/branches/alg/clibboard:r1428975-1437368
Modified: openoffice/trunk/main/canvas/source/vcl/bitmapbackbuffer.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/canvas/source/vcl/bitmapbackbuffer.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/canvas/source/vcl/bitmapbackbuffer.cxx (original)
+++ openoffice/trunk/main/canvas/source/vcl/bitmapbackbuffer.cxx Wed Jan 23 14:27:50 2013
@@ -85,6 +85,7 @@ namespace vclcanvas
{
// VDev content is more current than bitmap - copy contents before!
mpVDev->EnableMapMode( sal_False );
+ mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Point aEmptyPoint;
*maBitmap = mpVDev->GetBitmapEx( aEmptyPoint,
mpVDev->GetOutputSizePixel() );
@@ -105,6 +106,7 @@ namespace vclcanvas
if( mbVDevContentIsCurrent && mpVDev )
{
mpVDev->EnableMapMode( sal_False );
+ mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
aSize = mpVDev->GetOutputSizePixel();
}
@@ -148,6 +150,7 @@ namespace vclcanvas
{
// fill with bitmap content
mpVDev->EnableMapMode( sal_False );
+ mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Point aEmptyPoint;
mpVDev->DrawBitmapEx( aEmptyPoint, *maBitmap );
}
Modified: openoffice/trunk/main/canvas/source/vcl/canvashelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/canvas/source/vcl/canvashelper.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/canvas/source/vcl/canvashelper.cxx (original)
+++ openoffice/trunk/main/canvas/source/vcl/canvashelper.cxx Wed Jan 23 14:27:50 2013
@@ -162,6 +162,7 @@ namespace vclcanvas
{
mp2ndOutDev = rOutDev;
mp2ndOutDev->getOutDev().EnableMapMode( sal_False );
+ mp2ndOutDev->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
}
void CanvasHelper::clear()
@@ -173,6 +174,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev.SetLineColor( COL_WHITE );
rOutDev.SetFillColor( COL_WHITE );
rOutDev.DrawRect( Rectangle( Point(),
@@ -184,6 +186,7 @@ namespace vclcanvas
rOutDev2.SetDrawMode( DRAWMODE_DEFAULT );
rOutDev2.EnableMapMode( sal_False );
+ rOutDev2.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev2.SetLineColor( COL_WHITE );
rOutDev2.SetFillColor( COL_WHITE );
rOutDev2.DrawRect( Rectangle( Point(),
@@ -934,6 +937,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
// TODO(F2): Support alpha vdev canvas here
const Point aEmptyPoint(0,0);
@@ -963,6 +967,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(),
aRect.GetSize()) );
@@ -1016,6 +1021,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
const sal_uInt16 nBitCount( ::std::min( (sal_uInt16)24U,
@@ -1142,6 +1148,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1179,6 +1186,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1218,6 +1226,7 @@ namespace vclcanvas
OutputDevice* p2ndOutDev = NULL;
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
if( mp2ndOutDev )
p2ndOutDev = &mp2ndOutDev->getOutDev();
Modified: openoffice/trunk/main/canvas/source/vcl/impltools.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/canvas/source/vcl/impltools.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/canvas/source/vcl/impltools.hxx (original)
+++ openoffice/trunk/main/canvas/source/vcl/impltools.hxx Wed Jan 23 14:27:50 2013
@@ -137,14 +137,16 @@ namespace vclcanvas
public:
explicit OutDevStateKeeper( OutputDevice& rOutDev ) :
mpOutDev( &rOutDev ),
- mbMappingWasEnabled( mpOutDev->IsMapModeEnabled() )
+ mbMappingWasEnabled( mpOutDev->IsMapModeEnabled() ),
+ mnAntiAliasing( mpOutDev->GetAntialiasing() )
{
init();
}
explicit OutDevStateKeeper( const OutDevProviderSharedPtr& rOutDev ) :
mpOutDev( rOutDev.get() ? &(rOutDev->getOutDev()) : NULL ),
- mbMappingWasEnabled( mpOutDev ? mpOutDev->IsMapModeEnabled() : false )
+ mbMappingWasEnabled( mpOutDev ? mpOutDev->IsMapModeEnabled() : false ),
+ mnAntiAliasing( mpOutDev ? mpOutDev->GetAntialiasing() : 0 )
{
init();
}
@@ -154,6 +156,8 @@ namespace vclcanvas
if( mpOutDev )
{
mpOutDev->EnableMapMode( mbMappingWasEnabled );
+ mpOutDev->SetAntialiasing( mnAntiAliasing );
+
mpOutDev->Pop();
}
}
@@ -165,11 +169,13 @@ namespace vclcanvas
{
mpOutDev->Push();
mpOutDev->EnableMapMode(sal_False);
+ mpOutDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
}
}
- OutputDevice* mpOutDev;
- const bool mbMappingWasEnabled;
+ OutputDevice* mpOutDev;
+ const bool mbMappingWasEnabled;
+ const sal_uInt16 mnAntiAliasing;
};
::Point mapRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& rPoint,
Modified: openoffice/trunk/main/canvas/source/vcl/spritecanvashelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/canvas/source/vcl/spritecanvashelper.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/canvas/source/vcl/spritecanvashelper.cxx (original)
+++ openoffice/trunk/main/canvas/source/vcl/spritecanvashelper.cxx Wed Jan 23 14:27:50 2013
@@ -95,6 +95,7 @@ namespace vclcanvas
// wouldn't save much render time, and b) will clutter
// scrolled sprite content outside this area)
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev.SetClipRegion( rRequestedArea );
// repaint affected sprite directly to output device (at
@@ -329,6 +330,7 @@ namespace vclcanvas
// flush to screen
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev.SetClipRegion();
rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize,
aEmptyPoint, aOutDevSize,
@@ -574,6 +576,7 @@ namespace vclcanvas
// paint background
maVDev->EnableMapMode( sal_False );
+ maVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
maVDev->SetClipRegion();
maVDev->DrawOutDev( aEmptyPoint, aOutputSize,
aOutputPosition, aOutputSize,
@@ -591,6 +594,7 @@ namespace vclcanvas
// flush to screen
rOutDev.EnableMapMode( sal_False );
+ rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev.DrawOutDev( aOutputPosition, aOutputSize,
aEmptyPoint, aOutputSize,
*maVDev );
Modified: openoffice/trunk/main/canvas/source/vcl/spritedevicehelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/canvas/source/vcl/spritedevicehelper.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/canvas/source/vcl/spritedevicehelper.cxx (original)
+++ openoffice/trunk/main/canvas/source/vcl/spritedevicehelper.cxx Wed Jan 23 14:27:50 2013
@@ -141,6 +141,7 @@ namespace vclcanvas
const ::Point aEmptyPoint;
mpBackBuffer->getOutDev().EnableMapMode( sal_False );
+ mpBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
WriteDIB(mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint, mpBackBuffer->getOutDev().GetOutputSizePixel()), aStream, false, true);
}
Modified: openoffice/trunk/main/drawinglayer/Library_drawinglayer.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/Library_drawinglayer.mk?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/Library_drawinglayer.mk (original)
+++ openoffice/trunk/main/drawinglayer/Library_drawinglayer.mk Wed Jan 23 14:27:50 2013
@@ -156,8 +156,6 @@ $(eval $(call gb_Library_add_exception_o
drawinglayer/source/primitive3d/textureprimitive3d \
drawinglayer/source/primitive3d/transformprimitive3d \
drawinglayer/source/processor2d/baseprocessor2d \
- drawinglayer/source/processor2d/vclhelperbitmaptransform \
- drawinglayer/source/processor2d/vclhelperbitmaprender \
drawinglayer/source/processor2d/vclhelperbufferdevice \
drawinglayer/source/processor2d/vclprocessor2d \
drawinglayer/source/processor2d/helperwrongspellrenderer \
Modified: openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx Wed Jan 23 14:27:50 2013
@@ -31,9 +31,7 @@
#include <vcl/outdev.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
-#include <vclhelperbitmaptransform.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <vclhelperbitmaprender.hxx>
#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -410,7 +408,7 @@ namespace drawinglayer
if(maBColorModifierStack.count())
{
- aBitmapEx = impModifyBitmapEx(maBColorModifierStack, aBitmapEx);
+ aBitmapEx = aBitmapEx.ModifyBitmapEx(maBColorModifierStack);
if(aBitmapEx.IsEmpty())
{
@@ -427,36 +425,24 @@ namespace drawinglayer
}
}
- {
- static bool bForceUseOfOwnTransformer(false);
+ // decompose matrix to check for shear, rotate and mirroring
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
- // decompose matrix to check for shear, rotate and mirroring
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // #121387# when mirrored and rotated, avoid the GraphicManager output which has low quality
- const bool bRotated(!basegfx::fTools::equalZero(fRotate));
- const bool bSheared(!basegfx::fTools::equalZero(fShearX));
- //const bool bMirrored(aScale.getX() < 0.0 || aScale.getY() < 0.0);
- // const bool bMirroredAndRotated(bRotated && bMirrored);
+ aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
- if(!bForceUseOfOwnTransformer && !bRotated && !bSheared) // && !bMirrored)
- {
- RenderBitmapPrimitive2D_BitmapEx(*mpOutputDevice, aBitmapEx, aLocalTransform);
- }
- else
- {
- if(!aBitmapEx.IsTransparent() && (bSheared || bRotated))
- {
- // parts will be uncovered, extend aBitmapEx with a mask bitmap
- const Bitmap aContent(aBitmapEx.GetBitmap());
- aBitmapEx = BitmapEx(aContent, Bitmap(aContent.GetSizePixel(), 1));
- }
+ const bool bRotated(!basegfx::fTools::equalZero(fRotate));
+ const bool bSheared(!basegfx::fTools::equalZero(fShearX));
- RenderBitmapPrimitive2D_self(*mpOutputDevice, aBitmapEx, aLocalTransform);
- }
+ if(!aBitmapEx.IsTransparent() && (bSheared || bRotated))
+ {
+ // parts will be uncovered, extend aBitmapEx with a mask bitmap
+ const Bitmap aContent(aBitmapEx.GetBitmap());
+ aBitmapEx = BitmapEx(aContent, Bitmap(aContent.GetSizePixel(), 1));
}
+
+ // draw using OutputDevice'sDrawTransformedBitmapEx
+ mpOutputDevice->DrawTransformedBitmapEx(aLocalTransform, aBitmapEx);
}
void VclProcessor2D::RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D& rFillBitmapCandidate)
@@ -537,7 +523,7 @@ namespace drawinglayer
if(maBColorModifierStack.count())
{
// when color modifier, apply to bitmap
- aBitmapEx = impModifyBitmapEx(maBColorModifierStack, aBitmapEx);
+ aBitmapEx = aBitmapEx.ModifyBitmapEx(maBColorModifierStack);
// impModifyBitmapEx uses empty bitmap as sign to return that
// the content will be completely replaced to mono color, use shortcut
Modified: openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Draw.xcs?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Draw.xcs (original)
+++ openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Draw.xcs Wed Jan 23 14:27:50 2013
@@ -322,7 +322,7 @@
<desc>Indicates whether a double-click on an object activates the rotation mode.</desc>
<label>Rotation Mode after clicking object</label>
</info>
- <value>false</value>
+ <value>true</value>
</prop>
<prop oor:name="Preview" oor:type="xs:double">
<!-- OldPath: Draw/Other -->
Modified: openoffice/trunk/main/svx/source/sdr/contact/objectcontactofpageview.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sdr/contact/objectcontactofpageview.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sdr/contact/objectcontactofpageview.cxx (original)
+++ openoffice/trunk/main/svx/source/sdr/contact/objectcontactofpageview.cxx Wed Jan 23 14:27:50 2013
@@ -179,6 +179,7 @@ namespace sdr
const double fCurrentTime(getPrimitiveAnimator().GetTime());
OutputDevice& rTargetOutDev = GetPageWindow().GetPaintWindow().GetTargetOutputDevice();
basegfx::B2DRange aViewRange;
+ basegfx::B2DHomMatrix aViewTransformation;
// create ViewRange
if(isOutputToRecordingMetaFile())
@@ -228,12 +229,16 @@ namespace sdr
// transform to world coordinates
aViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
+
+ // for metafile, leave ViewTransformation empty, but for pixel renderer
+ // get it from OutputDevice
+ aViewTransformation = rTargetOutDev.GetViewTransformation();
}
// update local ViewInformation2D
const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
basegfx::B2DHomMatrix(),
- rTargetOutDev.GetViewTransformation(),
+ aViewTransformation,
aViewRange,
GetXDrawPageForSdrPage(GetSdrPage()),
fCurrentTime,
Modified: openoffice/trunk/main/svx/source/svdraw/svdhdl.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/svdhdl.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/svdhdl.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/svdhdl.cxx Wed Jan 23 14:27:50 2013
@@ -545,7 +545,7 @@ void SdrHdl::CreateB2dIAObject()
// for SJ and the CustomShapeHandles:
case HDL_CUSTOMSHAPE1:
{
- eKindOfMarker = (b1PixMore) ? Customshape_7x7 : Customshape_9x9;
+ eKindOfMarker = (b1PixMore) ? Customshape_9x9 : Customshape_7x7;
eColIndex = Yellow;
break;
}
Modified: openoffice/trunk/main/svx/source/svdraw/svdograf.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/svdograf.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/svdograf.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/svdograf.cxx Wed Jan 23 14:27:50 2013
@@ -737,7 +737,6 @@ void SdrGrafObj::ReleaseGraphicLink()
void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- FASTBOOL bAnim = pGraphic->IsAnimated();
FASTBOOL bNoPresGrf = ( pGraphic->GetType() != GRAPHIC_NONE ) && !bEmptyPresObj;
rInfo.bResizeFreeAllowed = aGeo.nDrehWink % 9000 == 0 ||
@@ -745,10 +744,10 @@ void SdrGrafObj::TakeObjInfo(SdrObjTrans
aGeo.nDrehWink % 27000 == 0;
rInfo.bResizePropAllowed = sal_True;
- rInfo.bRotateFreeAllowed = bNoPresGrf && !bAnim;
- rInfo.bRotate90Allowed = bNoPresGrf && !bAnim;
- rInfo.bMirrorFreeAllowed = bNoPresGrf && !bAnim;
- rInfo.bMirror45Allowed = bNoPresGrf && !bAnim;
+ rInfo.bRotateFreeAllowed = bNoPresGrf;
+ rInfo.bRotate90Allowed = bNoPresGrf;
+ rInfo.bMirrorFreeAllowed = bNoPresGrf;
+ rInfo.bMirror45Allowed = bNoPresGrf;
rInfo.bMirror90Allowed = !bEmptyPresObj;
rInfo.bTransparenceAllowed = sal_False;
rInfo.bGradientAllowed = sal_False;
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx Wed Jan 23 14:27:50 2013
@@ -1096,17 +1096,17 @@ sal_Bool AquaSalGraphics::drawPolyPolygo
// -----------------------------------------------------------------------
-void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraphics )
+void AquaSalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics *pSrcGraphics )
{
if( !pSrcGraphics )
pSrcGraphics = this;
//from unix salgdi2.cxx
//[FIXME] find a better way to prevent calc from crashing when width and height are negative
- if( pPosAry->mnSrcWidth <= 0
- || pPosAry->mnSrcHeight <= 0
- || pPosAry->mnDestWidth <= 0
- || pPosAry->mnDestHeight <= 0 )
+ if( rPosAry.mnSrcWidth <= 0
+ || rPosAry.mnSrcHeight <= 0
+ || rPosAry.mnDestWidth <= 0
+ || rPosAry.mnDestHeight <= 0 )
{
return;
}
@@ -1115,16 +1115,16 @@ void AquaSalGraphics::copyBits( const Sa
/*const*/ AquaSalGraphics* pSrc = static_cast<AquaSalGraphics*>(pSrcGraphics);
const bool bSameGraphics = (this == pSrc) || (mbWindow && mpFrame && pSrc->mbWindow && (mpFrame == pSrc->mpFrame));
if( bSameGraphics
- && (pPosAry->mnSrcWidth == pPosAry->mnDestWidth)
- && (pPosAry->mnSrcHeight == pPosAry->mnDestHeight))
+ && (rPosAry.mnSrcWidth == rPosAry.mnDestWidth)
+ && (rPosAry.mnSrcHeight == rPosAry.mnDestHeight))
{
// short circuit if there is nothing to do
- if( (pPosAry->mnSrcX == pPosAry->mnDestX)
- && (pPosAry->mnSrcY == pPosAry->mnDestY))
+ if( (rPosAry.mnSrcX == rPosAry.mnDestX)
+ && (rPosAry.mnSrcY == rPosAry.mnDestY))
return;
// use copyArea() if source and destination context are identical
- copyArea( pPosAry->mnDestX, pPosAry->mnDestY, pPosAry->mnSrcX, pPosAry->mnSrcY,
- pPosAry->mnSrcWidth, pPosAry->mnSrcHeight, 0 );
+ copyArea( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnSrcX, rPosAry.mnSrcY,
+ rPosAry.mnSrcWidth, rPosAry.mnSrcHeight, 0 );
return;
}
@@ -1133,8 +1133,8 @@ void AquaSalGraphics::copyBits( const Sa
DBG_ASSERT( pSrc->mxLayer!=NULL, "AquaSalGraphics::copyBits() from non-layered graphics" );
- const CGPoint aDstPoint = { +pPosAry->mnDestX - pPosAry->mnSrcX, pPosAry->mnDestY - pPosAry->mnSrcY };
- if( (pPosAry->mnSrcWidth == pPosAry->mnDestWidth && pPosAry->mnSrcHeight == pPosAry->mnDestHeight) &&
+ const CGPoint aDstPoint = { +rPosAry.mnDestX - rPosAry.mnSrcX, rPosAry.mnDestY - rPosAry.mnSrcY };
+ if( (rPosAry.mnSrcWidth == rPosAry.mnDestWidth && rPosAry.mnSrcHeight == rPosAry.mnDestHeight) &&
(!mnBitmapDepth || (aDstPoint.x + pSrc->mnWidth) <= mnWidth) ) // workaround a Quartz crasher
{
// in XOR mode the drawing context is redirected to the XOR mask
@@ -1145,7 +1145,7 @@ void AquaSalGraphics::copyBits( const Sa
xCopyContext = mpXorEmulation->GetTargetContext();
CGContextSaveGState( xCopyContext );
- const CGRect aDstRect = { {pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight} };
+ const CGRect aDstRect = { {rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight} };
CGContextClipToRect( xCopyContext, aDstRect );
// draw at new destination
@@ -1160,14 +1160,14 @@ void AquaSalGraphics::copyBits( const Sa
}
else
{
- SalBitmap* pBitmap = pSrc->getBitmap( pPosAry->mnSrcX, pPosAry->mnSrcY, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight );
+ SalBitmap* pBitmap = pSrc->getBitmap( rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcWidth, rPosAry.mnSrcHeight );
if( pBitmap )
{
- SalTwoRect aPosAry( *pPosAry );
+ SalTwoRect aPosAry( rPosAry );
aPosAry.mnSrcX = 0;
aPosAry.mnSrcY = 0;
- drawBitmap( &aPosAry, *pBitmap );
+ drawBitmap( aPosAry, *pBitmap );
delete pBitmap;
}
}
@@ -1192,7 +1192,7 @@ void AquaSalGraphics::copyArea( long nDs
aPosAry.mnDestY = nDstY;
aPosAry.mnDestWidth = nSrcWidth;
aPosAry.mnDestHeight = nSrcHeight;
- drawBitmap( &aPosAry, *pBitmap );
+ drawBitmap( aPosAry, *pBitmap );
delete pBitmap;
}
#else
@@ -1239,17 +1239,17 @@ void AquaSalGraphics::copyArea( long nDs
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
+void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap )
{
if( !CheckContext() )
return;
const AquaSalBitmap& rBitmap = static_cast<const AquaSalBitmap&>(rSalBitmap);
- CGImageRef xImage = rBitmap.CreateCroppedImage( (int)pPosAry->mnSrcX, (int)pPosAry->mnSrcY, (int)pPosAry->mnSrcWidth, (int)pPosAry->mnSrcHeight );
+ CGImageRef xImage = rBitmap.CreateCroppedImage( (int)rPosAry.mnSrcX, (int)rPosAry.mnSrcY, (int)rPosAry.mnSrcWidth, (int)rPosAry.mnSrcHeight );
if( !xImage )
return;
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}};
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
@@ -1257,26 +1257,26 @@ void AquaSalGraphics::drawBitmap( const
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,SalColor )
+void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,SalColor )
{
DBG_ERROR("not implemented for color masking!");
- drawBitmap( pPosAry, rSalBitmap );
+ drawBitmap( rPosAry, rSalBitmap );
}
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap )
+void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap )
{
if( !CheckContext() )
return;
const AquaSalBitmap& rBitmap = static_cast<const AquaSalBitmap&>(rSalBitmap);
const AquaSalBitmap& rMask = static_cast<const AquaSalBitmap&>(rTransparentBitmap);
- CGImageRef xMaskedImage( rBitmap.CreateWithMask( rMask, pPosAry->mnSrcX, pPosAry->mnSrcY, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ) );
+ CGImageRef xMaskedImage( rBitmap.CreateWithMask( rMask, rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcWidth, rPosAry.mnSrcHeight ) );
if( !xMaskedImage )
return;
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}};
CGContextDrawImage( mrContext, aDstRect, xMaskedImage );
CGImageRelease( xMaskedImage );
RefreshRect( aDstRect );
@@ -1284,17 +1284,17 @@ void AquaSalGraphics::drawBitmap( const
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawMask( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap, SalColor nMaskColor )
+void AquaSalGraphics::drawMask( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, SalColor nMaskColor )
{
if( !CheckContext() )
return;
const AquaSalBitmap& rBitmap = static_cast<const AquaSalBitmap&>(rSalBitmap);
- CGImageRef xImage = rBitmap.CreateColorMask( pPosAry->mnSrcX, pPosAry->mnSrcY, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight, nMaskColor );
+ CGImageRef xImage = rBitmap.CreateColorMask( rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcWidth, rPosAry.mnSrcHeight, nMaskColor );
if( !xImage )
return;
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}};
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
@@ -1531,6 +1531,19 @@ bool AquaSalGraphics::drawAlphaBitmap( c
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+bool AquaSalGraphics::drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap)
+{
+ // here direct support for transformed bitmaps can be impemented
+ (void)rNull; (void)rX; (void)rY; (void)rSourceBitmap; (void)pAlphaBitmap;
+ return false;
+}
+
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
Modified: openoffice/trunk/main/vcl/inc/aqua/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/aqua/salgdi.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/aqua/salgdi.h (original)
+++ openoffice/trunk/main/vcl/inc/aqua/salgdi.h Wed Jan 23 14:27:50 2013
@@ -199,15 +199,15 @@ public:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
@@ -223,6 +223,12 @@ public:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
Modified: openoffice/trunk/main/vcl/inc/os2/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/os2/salgdi.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/os2/salgdi.h (original)
+++ openoffice/trunk/main/vcl/inc/os2/salgdi.h Wed Jan 23 14:27:50 2013
@@ -182,15 +182,15 @@ protected:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
@@ -221,6 +221,12 @@ protected:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
public:
Modified: openoffice/trunk/main/vcl/inc/salgdi.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/salgdi.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/salgdi.hxx (original)
+++ openoffice/trunk/main/vcl/inc/salgdi.hxx Wed Jan 23 14:27:50 2013
@@ -97,8 +97,9 @@ class VCL_PLUGIN_PUBLIC SalGraphics
int m_nLayout; // 0: mirroring off, 1: mirror x-axis
protected:
+ /// bitfield
// flags which hold the SetAntialiasing() value from OutputDevice
- bool m_bAntiAliasB2DDraw;
+ bool m_bAntiAliasB2DDraw : 1;
public:
// get/set AA
@@ -135,15 +136,15 @@ protected:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
+ virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rMaskBitmap ) = 0;
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor ) = 0;
@@ -184,6 +185,15 @@ protected:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap ) = 0;
+
+ /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap) = 0;
+
/** Render solid rectangle with given transparency
@param nTransparency
@@ -401,23 +411,23 @@ public:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- void CopyBits( const SalTwoRect* pPosAry,
+ void CopyBits( const SalTwoRect& rPosAry,
SalGraphics* pSrcGraphics,
const OutputDevice *pOutDev,
const OutputDevice *pSrcOutDev );
- void DrawBitmap( const SalTwoRect* pPosAry,
+ void DrawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const OutputDevice *pOutDev );
- void DrawBitmap( const SalTwoRect* pPosAry,
+ void DrawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor,
const OutputDevice *pOutDev );
- void DrawBitmap( const SalTwoRect* pPosAry,
+ void DrawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap,
const OutputDevice *pOutDev );
- void DrawMask( const SalTwoRect* pPosAry,
+ void DrawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor,
const OutputDevice *pOutDev );
@@ -485,6 +495,14 @@ public:
const SalBitmap& rAlphaBitmap,
const OutputDevice *pOutDev );
+ bool DrawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap,
+ const OutputDevice* pOutDev );
+
bool DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
sal_uInt8 nTransparency, const OutputDevice *pOutDev );
Modified: openoffice/trunk/main/vcl/inc/unx/gtk/gtkgdi.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/unx/gtk/gtkgdi.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/unx/gtk/gtkgdi.hxx (original)
+++ openoffice/trunk/main/vcl/inc/unx/gtk/gtkgdi.hxx Wed Jan 23 14:27:50 2013
@@ -81,7 +81,7 @@ public:
// a control is painted; but presentation effects need
// the background set to None; workaround: set the background
// before copyBits
- virtual void copyBits( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry,
SalGraphics* pSrcGraphics );
protected:
Modified: openoffice/trunk/main/vcl/inc/unx/pspgraphics.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/unx/pspgraphics.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/unx/pspgraphics.h (original)
+++ openoffice/trunk/main/vcl/inc/unx/pspgraphics.h Wed Jan 23 14:27:50 2013
@@ -159,17 +159,17 @@ public:
long nSrcWidth,
long nSrcHeight,
sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
@@ -183,6 +183,12 @@ public:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
virtual SystemGraphicsData GetGraphicsData() const;
Modified: openoffice/trunk/main/vcl/inc/unx/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/unx/salgdi.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/unx/salgdi.h (original)
+++ openoffice/trunk/main/vcl/inc/unx/salgdi.h Wed Jan 23 14:27:50 2013
@@ -175,7 +175,7 @@ protected:
int &nSrcY,
Pixmap hClipMask );
using SalGraphics::DrawBitmap;
- void DrawBitmap( const SalTwoRect *pPosAry,
+ void DrawBitmap( const SalTwoRect& rPosAry,
SalGraphics *pThis,
const SalBitmap &rSalBitmap,
const SalBitmap &rTransparentBitmap,
@@ -184,7 +184,7 @@ protected:
GC GetFontGC();
bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
- void drawMaskedBitmap( const SalTwoRect* pPosAry,
+ void drawMaskedBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
@@ -312,17 +312,17 @@ public:
long nSrcWidth,
long nSrcHeight,
sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rMaskBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
@@ -335,6 +335,12 @@ public:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
Modified: openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx Wed Jan 23 14:27:50 2013
@@ -28,6 +28,7 @@
#include <vcl/bitmap.hxx>
#include <vcl/alpha.hxx>
#include <tools/color.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
// -------------------
// - TransparentType -
@@ -380,6 +381,44 @@ public:
0 is not transparent, 255 is fully transparent
*/
sal_uInt8 GetTransparency(sal_Int32 nX, sal_Int32 nY) const;
+
+ /** Create transformed Bitmap
+
+ @param fWidth
+ The target width in pixels
+
+ @param fHeight
+ The target height in pixels
+
+ @param rTransformation
+ The back transformation for each pixel in (0 .. fWidth),(0 .. fHeight) to
+ local pixel coordiantes
+ */
+ BitmapEx TransformBitmapEx(
+ double fWidth,
+ double fHeight,
+ const basegfx::B2DHomMatrix& rTransformation) const;
+
+ /** Create transformed Bitmap
+
+ @param rTransformation
+ The transformation from unit coordinates to target
+
+ @param fMaximumArea
+ A limitation for the maximum size of pixels to use for the result
+
+ @return The transformed bitmap
+ */
+ BitmapEx getTransformed(
+ const basegfx::B2DHomMatrix& rTransformation,
+ double fMaximumArea = 500000.0) const;
+
+ /** Create ColorStack-modified version of this BitmapEx
+
+ @param rBColorModifierStack
+ A ColrModifierStack which defines how each pixel has to be modified
+ */
+ BitmapEx ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorModifierStack) const;
};
#endif // _SV_BITMAPEX_HXX
Modified: openoffice/trunk/main/vcl/inc/vcl/outdev.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/outdev.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/outdev.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/outdev.hxx Wed Jan 23 14:27:50 2013
@@ -77,6 +77,7 @@ class SalLayout;
class ImplLayoutArgs;
class ImplFontAttributes;
class VirtualDevice;
+struct SalTwoRect;
namespace com {
namespace sun {
@@ -355,27 +356,29 @@ private:
Point maRefPoint;
sal_uInt16 mnAntialiasing;
LanguageType meTextLanguage;
- mutable sal_Bool mbMap:1,
- mbMapIsDefault:1,
- mbClipRegion:1,
- mbBackground:1,
- mbOutput:1,
- mbDevOutput:1,
- mbOutputClipped:1,
- mbLineColor:1,
- mbFillColor:1,
- mbInitLineColor:1,
- mbInitFillColor:1,
- mbInitFont:1,
- mbInitTextColor:1,
- mbInitClipRegion:1,
- mbClipRegionSet:1,
- mbKerning:1,
- mbNewFont:1,
- mbTextLines:1,
- mbTextSpecial:1,
- mbRefPoint:1,
- mbEnableRTL:1;
+
+ /// bitfield
+ mutable bool mbMap : 1;
+ mutable bool mbMapIsDefault : 1;
+ mutable bool mbClipRegion : 1;
+ mutable bool mbBackground : 1;
+ mutable bool mbOutput : 1;
+ mutable bool mbDevOutput : 1;
+ mutable bool mbOutputClipped : 1;
+ mutable bool mbLineColor : 1;
+ mutable bool mbFillColor : 1;
+ mutable bool mbInitLineColor : 1;
+ mutable bool mbInitFillColor : 1;
+ mutable bool mbInitFont : 1;
+ mutable bool mbInitTextColor : 1;
+ mutable bool mbInitClipRegion : 1;
+ mutable bool mbClipRegionSet : 1;
+ mutable bool mbKerning : 1;
+ mutable bool mbNewFont : 1;
+ mutable bool mbTextLines : 1;
+ mutable bool mbTextSpecial : 1;
+ mutable bool mbRefPoint : 1;
+ mutable bool mbEnableRTL : 1;
public:
SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; }
@@ -482,7 +485,7 @@ public:
SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
SAL_DLLPRIVATE void ImplDraw2ColorFrame( const Rectangle& rRect, const Color& rLeftTopColor, const Color& rRightBottomColor );
- SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
+ SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rPosAry );
SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const sal_uLong nAction );
@@ -772,6 +775,20 @@ public:
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const BitmapEx& rBitmapEx );
+ /** Draw BitampEx transformed
+
+ @param rTransformation
+ The transformation describing the target positioning of the given bitmap. Transforming
+ the unit object coordinates (0, 0, 1, 1) with this matrix is the transformation to
+ discrete coordinates
+
+ @param rBitmapEx
+ The BitmapEx to be painted
+ */
+ void DrawTransformedBitmapEx(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const BitmapEx& rBitmapEx);
+
void DrawMask( const Point& rDestPt,
const Bitmap& rBitmap, const Color& rMaskColor );
void DrawMask( const Point& rDestPt, const Size& rDestSize,
Modified: openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx Wed Jan 23 14:27:50 2013
@@ -282,8 +282,9 @@ struct VCL_DLLPUBLIC BitmapBuffer
// - StretchAndConvert -
// ---------------------
-VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
+VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert(
+ const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
+ sal_uLong nDstBitmapFormat, const BitmapPalette* pDstPal = NULL, const ColorMask* pDstMask = NULL );
// ------------------------------------------------------------------
Modified: openoffice/trunk/main/vcl/inc/win/salbmp.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/win/salbmp.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/win/salbmp.h (original)
+++ openoffice/trunk/main/vcl/inc/win/salbmp.h Wed Jan 23 14:27:50 2013
@@ -27,6 +27,7 @@
#include <tools/gen.hxx>
#include <win/wincomp.hxx>
#include <salbmp.hxx>
+#include <boost/shared_ptr.hpp>
// --------------
// - SalBitmap -
@@ -36,24 +37,38 @@ struct BitmapBuffer;
class BitmapColor;
class BitmapPalette;
class SalGraphics;
+namespace Gdiplus { class Bitmap; }
+typedef boost::shared_ptr< Gdiplus::Bitmap > GdiPlusBmpPtr;
class WinSalBitmap : public SalBitmap
{
private:
+ friend class GdiPlusBuffer; // allow buffer to remove maGdiPlusBitmap eventually
Size maSize;
HGLOBAL mhDIB;
HBITMAP mhDDB;
- sal_uInt16 mnBitCount;
+
+ // the buffered evtl. used Gdiplus::Bitmap instance. It is managed by
+ // GdiPlusBuffer. To make this safe, it is only handed out as shared
+ // pointer; the GdiPlusBuffer may delete the local instance
+ GdiPlusBmpPtr maGdiPlusBitmap;
+
+ sal_uInt16 mnBitCount;
+
+ Gdiplus::Bitmap* ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource);
+ Gdiplus::Bitmap* ImplCreateGdiPlusBitmap();
public:
HGLOBAL ImplGethDIB() const { return mhDIB; }
HBITMAP ImplGethDDB() const { return mhDDB; }
+
+ GdiPlusBmpPtr ImplGetGdiPlusBitmap(const WinSalBitmap* pAlphaSource = 0) const;
static HGLOBAL ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
- static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
+ static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 );
Modified: openoffice/trunk/main/vcl/inc/win/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/win/salgdi.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/win/salgdi.h (original)
+++ openoffice/trunk/main/vcl/inc/win/salgdi.h Wed Jan 23 14:27:50 2013
@@ -128,8 +128,14 @@ public:
class WinSalGraphics : public SalGraphics
{
+private:
+ HDC mhLocalDC; // HDC
+
+public:
+ HDC getHDC() { return mhLocalDC; }
+ void setHDC(HDC aNew) { mhLocalDC = aNew; }
+
public:
- HDC mhDC; // HDC
HWND mhWnd; // Window-Handle, when Window-Graphics
HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face
@@ -155,15 +161,17 @@ public:
KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font
int mnPenWidth; // Linienbreite
- sal_Bool mbStockPen; // is Pen a stockpen
- sal_Bool mbStockBrush; // is Brush a stcokbrush
- sal_Bool mbPen; // is Pen (FALSE == NULL_PEN)
- sal_Bool mbBrush; // is Brush (FALSE == NULL_BRUSH)
- sal_Bool mbPrinter; // is Printer
- sal_Bool mbVirDev; // is VirDev
- sal_Bool mbWindow; // is Window
- sal_Bool mbScreen; // is Screen compatible
- bool mbXORMode; // _every_ output with RasterOp XOR
+
+ /// bitfield
+ bool mbStockPen : 1; // is Pen a stockpen
+ bool mbStockBrush : 1; // is Brush a stcokbrush
+ bool mbPen : 1; // is Pen (FALSE == NULL_PEN)
+ bool mbBrush : 1; // is Brush (FALSE == NULL_BRUSH)
+ bool mbPrinter : 1; // is Printer
+ bool mbVirDev : 1; // is VirDev
+ bool mbWindow : 1; // is Window
+ bool mbScreen : 1; // is Screen compatible
+ bool mbXORMode : 1; // _every_ output with RasterOp XOR
// remember RGB values for SetLineColor/SetFillColor
SalColor maLineColor;
@@ -202,15 +210,15 @@ protected:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
@@ -239,8 +247,18 @@ protected:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
+private:
+ // local helpers
+ bool tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBitmap& rSrcBitmap);
+
public:
// public SalGraphics methods, the interface to teh independent vcl part
Modified: openoffice/trunk/main/vcl/inc/win/salvd.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/win/salvd.h?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/win/salvd.h (original)
+++ openoffice/trunk/main/vcl/inc/win/salvd.h Wed Jan 23 14:27:50 2013
@@ -34,8 +34,14 @@ class WinSalGraphics;
class WinSalVirtualDevice : public SalVirtualDevice
{
+private:
+ HDC mhLocalDC; // HDC or 0 for Cache Device
+
+public:
+ HDC getHDC() { return mhLocalDC; }
+ void setHDC(HDC aNew) { mhLocalDC = aNew; }
+
public:
- HDC mhDC; // HDC or 0 for Cache Device
HBITMAP mhBmp; // Memory Bitmap
HBITMAP mhDefBmp; // Default Bitmap
WinSalGraphics* mpGraphics; // current VirDev graphics
Modified: openoffice/trunk/main/vcl/os2/source/gdi/salgdi2.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/os2/source/gdi/salgdi2.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/os2/source/gdi/salgdi2.cxx (original)
+++ openoffice/trunk/main/vcl/os2/source/gdi/salgdi2.cxx Wed Jan 23 14:27:50 2013
@@ -51,7 +51,7 @@ bool Os2SalGraphics::supportsOperation(
}
-void Os2SalGraphics::copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics )
+void Os2SalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
{
HPS hSrcPS;
POINTL thePoints[4];
@@ -71,22 +71,22 @@ void Os2SalGraphics::copyBits( const Sal
}
// lower-left corner of target
- thePoints[0].x = pPosAry->mnDestX;
- thePoints[0].y = TY( pPosAry->mnDestY + pPosAry->mnDestHeight - 1 );
+ thePoints[0].x = rPosAry.mnDestX;
+ thePoints[0].y = TY( rPosAry.mnDestY + rPosAry.mnDestHeight - 1 );
// upper-right corner of target
- thePoints[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth;
- thePoints[1].y = TY( pPosAry->mnDestY - 1 );
+ thePoints[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth;
+ thePoints[1].y = TY( rPosAry.mnDestY - 1 );
// lower-left corner of source
- thePoints[2].x = pPosAry->mnSrcX;
- thePoints[2].y = nSrcHeight - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
+ thePoints[2].x = rPosAry.mnSrcX;
+ thePoints[2].y = nSrcHeight - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
- if ( ( pPosAry->mnDestWidth != pPosAry->mnSrcWidth ) || ( pPosAry->mnDestHeight != pPosAry->mnSrcHeight ) )
+ if ( ( rPosAry.mnDestWidth != rPosAry.mnSrcWidth ) || ( rPosAry.mnDestHeight != rPosAry.mnSrcHeight ) )
{
// upper-right corner of Source
- thePoints[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- thePoints[3].y = nSrcHeight - pPosAry->mnSrcY + pPosAry->mnSrcHeight;
+ thePoints[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ thePoints[3].y = nSrcHeight - rPosAry.mnSrcY + rPosAry.mnSrcHeight;
GpiBitBlt( mhPS, hSrcPS, 4, thePoints,
mbXORMode ? ROP_SRCINVERT : ROP_SRCCOPY, BBO_IGNORE );
@@ -275,7 +275,7 @@ void Os2SalGraphics::copyArea( long nDes
// -----------------------------------------------------------------------
void ImplDrawBitmap( HPS hPS, long nScreenHeight,
- const SalTwoRect* pPosAry, const Os2SalBitmap& rSalBitmap,
+ const SalTwoRect& rPosAry, const Os2SalBitmap& rSalBitmap,
PM_BOOL bPrinter, int nDrawMode )
{
if( hPS )
@@ -305,15 +305,15 @@ void ImplDrawBitmap( HPS hPS, long nScre
long nInfoSize = *(ULONG*) pBI + rSalBitmap.ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGB2 );
PM_BYTE* pBits = (PM_BYTE*) pBI + nInfoSize;
- pts[0].x = pPosAry->mnDestX;
- pts[0].y = nScreenHeight - pPosAry->mnDestY - pPosAry->mnDestHeight;
- pts[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth - 1;
- pts[1].y = nScreenHeight - pPosAry->mnDestY - 1;
-
- pts[2].x = pPosAry->mnSrcX;
- pts[2].y = nHeight - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
- pts[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- pts[3].y = nHeight - pPosAry->mnSrcY;
+ pts[0].x = rPosAry.mnDestX;
+ pts[0].y = nScreenHeight - rPosAry.mnDestY - rPosAry.mnDestHeight;
+ pts[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth - 1;
+ pts[1].y = nScreenHeight - rPosAry.mnDestY - 1;
+
+ pts[2].x = rPosAry.mnSrcX;
+ pts[2].y = nHeight - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
+ pts[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ pts[3].y = nHeight - rPosAry.mnSrcY;
// if we've got a 1Bit DIB, we create a 4Bit substitute
if( ( pBIH->cBitCount == 1 ) && !hSubst )
@@ -400,15 +400,15 @@ void ImplDrawBitmap( HPS hPS, long nScre
{
POINTL pts[ 4 ];
- pts[0].x = pPosAry->mnDestX;
- pts[0].y = nScreenHeight - pPosAry->mnDestY - pPosAry->mnDestHeight;
- pts[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth - 1;
- pts[1].y = nScreenHeight - pPosAry->mnDestY - 1;
-
- pts[2].x = pPosAry->mnSrcX;
- pts[2].y = rSalBitmap.GetSize().Height() - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
- pts[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- pts[3].y = rSalBitmap.GetSize().Height() - pPosAry->mnSrcY;
+ pts[0].x = rPosAry.mnDestX;
+ pts[0].y = nScreenHeight - rPosAry.mnDestY - rPosAry.mnDestHeight;
+ pts[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth - 1;
+ pts[1].y = nScreenHeight - rPosAry.mnDestY - 1;
+
+ pts[2].x = rPosAry.mnSrcX;
+ pts[2].y = rSalBitmap.GetSize().Height() - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
+ pts[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ pts[3].y = rSalBitmap.GetSize().Height() - rPosAry.mnSrcY;
GpiWCBitBlt( hPS, hDrawDDB, 4L, pts, nDrawMode, BBO_IGNORE );
/*
@@ -425,30 +425,29 @@ void ImplDrawBitmap( HPS hPS, long nScre
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap )
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap )
{
ImplDrawBitmap( mhPS, mnHeight,
- pPosAry, static_cast<const Os2SalBitmap&>(rSalBitmap),
+ rPosAry, static_cast<const Os2SalBitmap&>(rSalBitmap),
mbPrinter,
mbXORMode ? ROP_SRCINVERT : ROP_SRCCOPY );
}
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor )
{
DBG_ASSERT( !mbPrinter, "No transparency print possible!" );
//const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
// an FM: kann erst einmal unberuecksichtigt bleiben
- drawBitmap( pPosAry, rSalBitmap );
+ drawBitmap( rPosAry, rSalBitmap );
}
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSSalBitmap,
const SalBitmap& rSTransparentBitmap )
{
@@ -459,12 +458,12 @@ void Os2SalGraphics::drawBitmap( const S
if( bFastTransparent )
{
- ImplDrawBitmap( mhPS, mnHeight, pPosAry, rTransparentBitmap, FALSE, ROP_SRCAND );
- ImplDrawBitmap( mhPS, mnHeight, pPosAry, rSalBitmap, FALSE, ROP_SRCPAINT );
+ ImplDrawBitmap( mhPS, mnHeight, rPosAry, rTransparentBitmap, FALSE, ROP_SRCAND );
+ ImplDrawBitmap( mhPS, mnHeight, rPosAry, rSalBitmap, FALSE, ROP_SRCPAINT );
}
else
{
- SalTwoRect aPosAry = *pPosAry;
+ SalTwoRect aPosAry = rPosAry;
int nDstX = (int) aPosAry.mnDestX;
int nDstY = (int) aPosAry.mnDestY;
int nDstWidth = (int) aPosAry.mnDestWidth;
@@ -497,13 +496,13 @@ void Os2SalGraphics::drawBitmap( const S
aPtL[ 2 ].y = TY( nDstY + nDstHeight - 1 );
GpiBitBlt( hMemPS, hPS, 3, aPtL, ROP_SRCCOPY, BBO_IGNORE );
- ImplDrawBitmap( hMaskPS, nDstHeight, &aPosAry, rTransparentBitmap, FALSE, ROP_SRCCOPY );
+ ImplDrawBitmap( hMaskPS, nDstHeight, aPosAry, rTransparentBitmap, FALSE, ROP_SRCCOPY );
aPtL[ 2 ].x = 0;
aPtL[ 2 ].y = 0;
GpiBitBlt( hMemPS, hMaskPS, 3, aPtL, ROP_SRCAND, BBO_IGNORE );
- ImplDrawBitmap( hMaskPS, nDstHeight, &aPosAry, rSalBitmap, FALSE, ROP_SRCERASE );
+ ImplDrawBitmap( hMaskPS, nDstHeight, aPosAry, rSalBitmap, FALSE, ROP_SRCERASE );
GpiBitBlt( hMemPS, hMaskPS, 3, aPtL, ROP_SRCPAINT, BBO_IGNORE );
aPtL[ 0 ].x = nDstX;
@@ -542,6 +541,20 @@ bool Os2SalGraphics::drawAlphaBitmap( co
// -----------------------------------------------------------------------
+bool Os2SalGraphics::drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap)
+{
+ // here direct support for transformed bitmaps can be impemented
+ (void)rNull; (void)rX; (void)rY; (void)rSourceBitmap; (void)pAlphaBitmap;
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
bool Os2SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
@@ -551,7 +564,7 @@ bool Os2SalGraphics::drawAlphaRect( long
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawMask( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSSalBitmap,
SalColor nMaskColor )
{
@@ -559,7 +572,7 @@ void Os2SalGraphics::drawMask( const Sal
const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
- SalTwoRect aPosAry = *pPosAry;
+ SalTwoRect aPosAry = rPosAry;
HPS hPS = mhPS;
IMAGEBUNDLE aBundle, aOldBundle;
AREABUNDLE aAreaBundle, aOldAreaBundle;
@@ -582,7 +595,7 @@ void Os2SalGraphics::drawMask( const Sal
Ft2SetAttrs( hPS, PRIM_AREA, ABB_COLOR | ABB_BACK_COLOR | ABB_SYMBOL |
ABB_MIX_MODE | ABB_BACK_MIX_MODE, 0, &aAreaBundle );
- ImplDrawBitmap( hPS, mnHeight, &aPosAry, rSalBitmap, FALSE, 0x00B8L );
+ ImplDrawBitmap( hPS, mnHeight, aPosAry, rSalBitmap, FALSE, 0x00B8L );
Ft2SetAttrs( hPS, PRIM_IMAGE, IBB_COLOR | IBB_BACK_COLOR, 0, &aOldBundle );
Ft2SetAttrs( hPS, PRIM_AREA, ABB_COLOR | ABB_BACK_COLOR | ABB_SYMBOL |
Modified: openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx?rev=1437407&r1=1437406&r2=1437407&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx Wed Jan 23 14:27:50 2013
@@ -37,6 +37,7 @@
#include <vcl/dibtools.hxx>
#include <image.h>
#include <impimagetree.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
// ------------
// - BitmapEx -
@@ -833,4 +834,371 @@ sal_uInt8 BitmapEx::GetTransparency(sal_
}
// ------------------------------------------------------------------
+
+namespace
+{
+ void impSmoothPoint(BitmapColor& rValue, const basegfx::B2DPoint& rSource, sal_Int32 nIntX, sal_Int32 nIntY, BitmapReadAccess& rRead)
+ {
+ double fDeltaX(rSource.getX() - nIntX);
+ double fDeltaY(rSource.getY() - nIntY);
+ sal_Int32 nIndX(0L);
+ sal_Int32 nIndY(0L);
+
+ if(fDeltaX > 0.0 && nIntX + 1L < rRead.Width())
+ {
+ nIndX++;
+ }
+ else if(fDeltaX < 0.0 && nIntX >= 1L)
+ {
+ fDeltaX = -fDeltaX;
+ nIndX--;
+ }
+
+ if(fDeltaY > 0.0 && nIntY + 1L < rRead.Height())
+ {
+ nIndY++;
+ }
+ else if(fDeltaY < 0.0 && nIntY >= 1L)
+ {
+ fDeltaY = -fDeltaY;
+ nIndY--;
+ }
+
+ if(nIndX || nIndY)
+ {
+ const double fColorToReal(1.0 / 255.0);
+ double fR(rValue.GetRed() * fColorToReal);
+ double fG(rValue.GetGreen() * fColorToReal);
+ double fB(rValue.GetBlue() * fColorToReal);
+ double fRBottom(0.0), fGBottom(0.0), fBBottom(0.0);
+
+ if(nIndX)
+ {
+ const double fMulA(fDeltaX * fColorToReal);
+ double fMulB(1.0 - fDeltaX);
+ const BitmapColor aTopPartner(rRead.GetColor(nIntY, nIntX + nIndX));
+
+ fR = (fR * fMulB) + (aTopPartner.GetRed() * fMulA);
+ fG = (fG * fMulB) + (aTopPartner.GetGreen() * fMulA);
+ fB = (fB * fMulB) + (aTopPartner.GetBlue() * fMulA);
+
+ if(nIndY)
+ {
+ fMulB *= fColorToReal;
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+ const BitmapColor aBottomPartner(rRead.GetColor(nIntY + nIndY, nIntX + nIndX));
+
+ fRBottom = (aBottom.GetRed() * fMulB) + (aBottomPartner.GetRed() * fMulA);
+ fGBottom = (aBottom.GetGreen() * fMulB) + (aBottomPartner.GetGreen() * fMulA);
+ fBBottom = (aBottom.GetBlue() * fMulB) + (aBottomPartner.GetBlue() * fMulA);
+ }
+ }
+
+ if(nIndY)
+ {
+ if(!nIndX)
+ {
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+
+ fRBottom = aBottom.GetRed() * fColorToReal;
+ fGBottom = aBottom.GetGreen() * fColorToReal;
+ fBBottom = aBottom.GetBlue() * fColorToReal;
+ }
+
+ const double fMulB(1.0 - fDeltaY);
+
+ fR = (fR * fMulB) + (fRBottom * fDeltaY);
+ fG = (fG * fMulB) + (fGBottom * fDeltaY);
+ fB = (fB * fMulB) + (fBBottom * fDeltaY);
+ }
+
+ rValue.SetRed((sal_uInt8)(fR * 255.0));
+ rValue.SetGreen((sal_uInt8)(fG * 255.0));
+ rValue.SetBlue((sal_uInt8)(fB * 255.0));
+ }
+ }
+
+ Bitmap impTransformBitmap(
+ const Bitmap& rSource,
+ const Size aDestinationSize,
+ const basegfx::B2DHomMatrix& rTransform,
+ bool bSmooth)
+ {
+ Bitmap aDestination(aDestinationSize, 24);
+ BitmapWriteAccess* pWrite = aDestination.AcquireWriteAccess();
+
+ if(pWrite)
+ {
+ const Size aContentSizePixel(rSource.GetSizePixel());
+ BitmapReadAccess* pRead = (const_cast< Bitmap& >(rSource)).AcquireReadAccess();
+
+ if(pRead)
+ {
+ const Size aDestinationSizePixel(aDestination.GetSizePixel());
+ bool bWorkWithIndex(rSource.GetBitCount() <= 8);
+ BitmapColor aOutside(BitmapColor(0xff, 0xff, 0xff));
+
+ for(sal_Int32 y(0L); y < aDestinationSizePixel.getHeight(); y++)
+ {
+ for(sal_Int32 x(0L); x < aDestinationSizePixel.getWidth(); x++)
+ {
+ const basegfx::B2DPoint aSourceCoor(rTransform * basegfx::B2DPoint(x, y));
+ const sal_Int32 nIntX(basegfx::fround(aSourceCoor.getX()));
+
+ if(nIntX >= 0L && nIntX < aContentSizePixel.getWidth())
+ {
+ const sal_Int32 nIntY(basegfx::fround(aSourceCoor.getY()));
+
+ if(nIntY >= 0L && nIntY < aContentSizePixel.getHeight())
+ {
+ // inside pixel
+ BitmapColor aValue;
+
+ if(bWorkWithIndex)
+ {
+ aValue = pRead->GetPaletteColor(pRead->GetPixelIndex(nIntY, nIntX));
+ }
+ else
+ {
+ aValue = pRead->GetPixel(nIntY, nIntX);
+ }
+
+ if(bSmooth)
+ {
+ impSmoothPoint(aValue, aSourceCoor, nIntX, nIntY, *pRead);
+ }
+
+ pWrite->SetPixel(y, x, aValue);
+ continue;
+ }
+ }
+
+ // here are outside pixels. Complete mask
+ if(bWorkWithIndex)
+ {
+ pWrite->SetPixel(y, x, aOutside);
+ }
+ }
+ }
+
+ delete pRead;
+ }
+
+ delete pWrite;
+ }
+
+ rSource.AdaptBitCount(aDestination);
+
+ return aDestination;
+ }
+} // end of anonymous namespace
+BitmapEx BitmapEx::TransformBitmapEx(
+ double fWidth,
+ double fHeight,
+ const basegfx::B2DHomMatrix& rTransformation) const
+{
+ if(fWidth <= 1 || fHeight <= 1)
+ return BitmapEx();
+
+ // force destination to 24 bit, we want to smooth output
+ const Size aDestinationSize(basegfx::fround(fWidth), basegfx::fround(fHeight));
+ static bool bDoSmoothAtAll(true);
+ const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bDoSmoothAtAll));
+
+ // create mask
+ if(IsTransparent())
+ {
+ if(IsAlpha())
+ {
+ const Bitmap aAlpha(impTransformBitmap(GetAlpha().GetBitmap(), aDestinationSize, rTransformation, bDoSmoothAtAll));
+ return BitmapEx(aDestination, AlphaMask(aAlpha));
+ }
+ else
+ {
+ const Bitmap aMask(impTransformBitmap(GetMask(), aDestinationSize, rTransformation, false));
+ return BitmapEx(aDestination, aMask);
+ }
+ }
+
+ return BitmapEx(aDestination);
+}
+
+// ------------------------------------------------------------------
+
+BitmapEx BitmapEx::getTransformed(
+ const basegfx::B2DHomMatrix& rTransformation,
+ double fMaximumArea) const
+{
+ BitmapEx aRetval;
+
+ if(IsEmpty())
+ return aRetval;
+
+ const sal_uInt32 nSourceWidth(GetSizePixel().Width());
+ const sal_uInt32 nSourceHeight(GetSizePixel().Height());
+
+ if(!nSourceWidth || !nSourceHeight)
+ return aRetval;
+
+ // Get dest range
+ basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+ aOutlineRange.transform(rTransformation);
+
+ // get target size
+ double fWidth(aOutlineRange.getWidth());
+ double fHeight(aOutlineRange.getHeight());
+
+ if(fWidth < 1.0 || fHeight < 1.0)
+ return aRetval;
+
+ // test if discrete size (pixel) maybe too big and limit it
+ const double fArea(fWidth * fHeight);
+ const bool bNeedToReduce(fArea > fMaximumArea);
+ double fReduceFactor(1.0);
+
+ if(bNeedToReduce)
+ {
+ fReduceFactor = sqrt(fMaximumArea / fArea);
+ fWidth *= fReduceFactor;
+ fHeight *= fReduceFactor;
+ }
+
+ // Build complete transform from source pixels to target pixels.
+ // Start by scaling from source pixel size to unit coordinates
+ basegfx::B2DHomMatrix aTransform(
+ basegfx::tools::createScaleB2DHomMatrix(
+ 1.0 / nSourceWidth,
+ 1.0 / nSourceHeight));
+
+ // multiply with given transform which leads from unit coordinates inside
+ // aOutlineRange
+ aTransform = rTransformation * aTransform;
+
+ // substract top-left of aOutlineRange
+ aTransform.translate(-aOutlineRange.getMinX(), -aOutlineRange.getMinY());
+
+ // scale to target pixels (if needed)
+ if(bNeedToReduce)
+ {
+ aTransform.scale(fReduceFactor, fReduceFactor);
+ }
+
+ // invert to get transformation from target pixel coordiates to source pixels
+ aTransform.invert();
+
+ // create bitmap using source, destination and linear back-transformation
+ aRetval = TransformBitmapEx(fWidth, fHeight, aTransform);
+
+ return aRetval;
+}
+
+// ------------------------------------------------------------------
+
+BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorModifierStack) const
+{
+ Bitmap aChangedBitmap(GetBitmap());
+ bool bDone(false);
+
+ for(sal_uInt32 a(rBColorModifierStack.count()); a && !bDone; )
+ {
+ const basegfx::BColorModifier& rModifier = rBColorModifierStack.getBColorModifier(--a);
+
+ switch(rModifier.getMode())
+ {
+ case basegfx::BCOLORMODIFYMODE_REPLACE :
+ {
+ // complete replace
+ if(IsTransparent())
+ {
+ // clear bitmap with dest color
+ if(aChangedBitmap.GetBitCount() <= 8)
+ {
+ // do NOT use erase; for e.g. 8bit Bitmaps, the nearest color to the given
+ // erase color is determined and used -> this may be different from what is
+ // wanted here. Better create a new bitmap with the needed color explicitely
+ BitmapReadAccess* pReadAccess = aChangedBitmap.AcquireReadAccess();
+ OSL_ENSURE(pReadAccess, "Got no Bitmap ReadAccess ?!?");
+
+ if(pReadAccess)
+ {
+ BitmapPalette aNewPalette(pReadAccess->GetPalette());
+ aNewPalette[0] = BitmapColor(Color(rModifier.getBColor()));
+ aChangedBitmap = Bitmap(
+ aChangedBitmap.GetSizePixel(),
+ aChangedBitmap.GetBitCount(),
+ &aNewPalette);
+ delete pReadAccess;
+ }
+ }
+ else
+ {
+ aChangedBitmap.Erase(Color(rModifier.getBColor()));
+ }
+ }
+ else
+ {
+ // erase bitmap, caller will know to paint direct
+ aChangedBitmap.SetEmpty();
+ }
+
+ bDone = true;
+ break;
+ }
+
+ default : // BCOLORMODIFYMODE_INTERPOLATE, BCOLORMODIFYMODE_GRAY, BCOLORMODIFYMODE_BLACKANDWHITE
+ {
+ BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess();
+
+ if(pContent)
+ {
+ const double fConvertColor(1.0 / 255.0);
+
+ for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
+ {
+ for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
+ {
+ const BitmapColor aBMCol(pContent->GetColor(y, x));
+ const basegfx::BColor aBSource(
+ (double)aBMCol.GetRed() * fConvertColor,
+ (double)aBMCol.GetGreen() * fConvertColor,
+ (double)aBMCol.GetBlue() * fConvertColor);
+ const basegfx::BColor aBDest(rModifier.getModifiedColor(aBSource));
+
+ pContent->SetPixel(y, x, BitmapColor(Color(aBDest)));
+ }
+ }
+
+ delete pContent;
+ }
+
+ break;
+ }
+ }
+ }
+
+ if(aChangedBitmap.IsEmpty())
+ {
+ return BitmapEx();
+ }
+ else
+ {
+ if(IsTransparent())
+ {
+ if(IsAlpha())
+ {
+ return BitmapEx(aChangedBitmap, GetAlpha());
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap, GetMask());
+ }
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap);
+ }
+ }
+}
+
+// ------------------------------------------------------------------
// eof