Kaydet (Commit) 2b8352eb authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Paint background images always via drawinglayer

Painting via GraphicObject is obsolete.
See fdo#68927 where the problem was the quality of svg
graphics, it seems a good idea to extend this improvement
to all graphic type.

Change-Id: I57a26d4fcfea8e4f666504a90281365e8a9a7e1d
üst 2cfce42e
...@@ -431,14 +431,6 @@ public: ...@@ -431,14 +431,6 @@ public:
sal_uLong nFlags = GRFMGR_DRAW_STANDARD sal_uLong nFlags = GRFMGR_DRAW_STANDARD
); );
bool DrawWithPDFHandling(
OutputDevice& rOutDev,
const Point& rPt,
const Size& rSz,
const GraphicAttr* pGrfAttr = NULL,
const sal_uLong nFlags = GRFMGR_DRAW_STANDARD
);
/** Draw the graphic repeatedly into the given output rectangle /** Draw the graphic repeatedly into the given output rectangle
@param pOut @param pOut
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <svtools/grfmgr.hxx> #include <svtools/grfmgr.hxx>
#include <vcl/pdfextoutdevdata.hxx>
#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
...@@ -607,67 +605,6 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, ...@@ -607,67 +605,6 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
return bRet; return bRet;
} }
// #i105243#
bool GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
const Point& rPt, const Size& rSz,
const GraphicAttr* pGrfAttr,
const sal_uLong nFlags )
{
const GraphicAttr aGrfAttr( pGrfAttr ? *pGrfAttr : GetAttr() );
// Notify PDF writer about linked graphic (if any)
bool bWritingPdfLinkedGraphic( false );
Point aPt( rPt );
Size aSz( rSz );
Rectangle aCropRect;
vcl::PDFExtOutDevData* pPDFExtOutDevData =
dynamic_cast<vcl::PDFExtOutDevData*>(rOutDev.GetExtOutDevData());
if( pPDFExtOutDevData )
{
// only delegate image handling to PDF, if no special treatment is necessary
if( GetGraphic().IsLink() &&
rSz.Width() > 0L &&
rSz.Height() > 0L &&
!aGrfAttr.IsSpecialDrawMode() &&
!aGrfAttr.IsMirrored() &&
!aGrfAttr.IsRotated() &&
!aGrfAttr.IsAdjusted() )
{
bWritingPdfLinkedGraphic = true;
if( aGrfAttr.IsCropped() )
{
tools::PolyPolygon aClipPolyPoly;
bool bRectClip;
const bool bCrop = ImplGetCropParams( &rOutDev,
aPt, aSz,
&aGrfAttr,
aClipPolyPoly,
bRectClip );
if ( bCrop && bRectClip )
{
aCropRect = aClipPolyPoly.GetBoundRect();
}
}
pPDFExtOutDevData->BeginGroup();
}
}
bool bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags );
// Notify PDF writer about linked graphic (if any)
if( bWritingPdfLinkedGraphic )
{
pPDFExtOutDevData->EndGroup( const_cast< Graphic& >(GetGraphic()),
aGrfAttr.GetTransparency(),
Rectangle( aPt, aSz ),
aCropRect );
}
return bRet;
}
bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ) const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D )
{ {
......
...@@ -1824,15 +1824,8 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, ...@@ -1824,15 +1824,8 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
// used, these coordinates have to be determined on pixel level. // used, these coordinates have to be determined on pixel level.
::SwAlignGrfRect( &aAlignedGrfRect, *pOut ); ::SwAlignGrfRect( &aAlignedGrfRect, *pOut );
if (pGrf->GetGraphic().getSvgData().get()) paintGraphicUsingPrimitivesHelper(*pOut,
{ // fdo#68927 - SVGs are rasterized badly by DrawWithPDFHandling *pGrf, pGrf->GetAttr(), aAlignedGrfRect);
paintGraphicUsingPrimitivesHelper(*pOut,
*pGrf, pGrf->GetAttr(), aAlignedGrfRect);
}
else
{
pGrf->DrawWithPDFHandling( *pOut, aAlignedGrfRect.Pos(), aAlignedGrfRect.SSize() );
}
if ( bNotInside ) if ( bNotInside )
pOut->Pop(); pOut->Pop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment