Kaydet (Commit) cc656270 authored tarafından Caolán McNamara's avatar Caolán McNamara

svp: route copyBits through cairo

Change-Id: I9521f7fecc59197efb17526a365cf4c9b259975f
üst 50c2d561
...@@ -1090,36 +1090,9 @@ void SvpSalGraphics::copyArea( long nDestX, ...@@ -1090,36 +1090,9 @@ void SvpSalGraphics::copyArea( long nDestX,
dbgOut( m_aDevice ); dbgOut( m_aDevice );
} }
void SvpSalGraphics::copyBits( const SalTwoRect& rPosAry, void SvpSalGraphics::copySource( const SalTwoRect& rTR,
SalGraphics* pSrcGraphics ) cairo_surface_t* source )
{ {
if( !m_aDevice.get() )
return;
SvpSalGraphics* pSrc = pSrcGraphics ?
static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
basegfx::B2IBox aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
rPosAry.mnSrcX+rPosAry.mnSrcWidth,
rPosAry.mnSrcY+rPosAry.mnSrcHeight );
basegfx::B2IBox aDestRect( rPosAry.mnDestX, rPosAry.mnDestY,
rPosAry.mnDestX+rPosAry.mnDestWidth,
rPosAry.mnDestY+rPosAry.mnDestHeight );
SvpSalGraphics::ClipUndoHandle aUndo( this );
if( !isClippedSetup( aDestRect, aUndo ) )
m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, basebmp::DrawMode::Paint, m_aClipMap );
dbgOut( m_aDevice );
}
void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceBitmap)
{
SourceHelper aSurface(rSourceBitmap);
cairo_surface_t* source = aSurface.getSurface();
if (!source)
{
SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap case");
}
cairo_t* cr = getCairoContext(false); cairo_t* cr = getCairoContext(false);
assert(cr && m_aDevice->isTopDown()); assert(cr && m_aDevice->isTopDown());
clipRegion(cr); clipRegion(cr);
...@@ -1138,6 +1111,36 @@ void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceB ...@@ -1138,6 +1111,36 @@ void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceB
releaseCairoContext(cr, false, extents); releaseCairoContext(cr, false, extents);
} }
void SvpSalGraphics::copyBits( const SalTwoRect& rTR,
SalGraphics* pSrcGraphics )
{
SvpSalGraphics* pSrc = pSrcGraphics ?
static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
cairo_surface_t* source = SvpSalGraphics::createCairoSurface(pSrc->m_aOrigDevice);
if (!source)
{
SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawBitmap case");
return;
}
copySource(rTR, source);
cairo_surface_destroy(source);
}
void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceBitmap)
{
SourceHelper aSurface(rSourceBitmap);
cairo_surface_t* source = aSurface.getSurface();
if (!source)
{
SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawBitmap case");
}
copySource(rTR, source);
}
void SvpSalGraphics::drawBitmap( const SalTwoRect& rPosAry, void SvpSalGraphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap, const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap ) const SalBitmap& rTransparentBitmap )
......
...@@ -82,6 +82,7 @@ private: ...@@ -82,6 +82,7 @@ private:
bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo ); bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo );
void ensureClip(); void ensureClip();
void invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags); void invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags);
void copySource(const SalTwoRect& rTR, cairo_surface_t* source);
protected: protected:
vcl::Region m_aClipRegion; vcl::Region m_aClipRegion;
SvpCairoTextRender m_aTextRenderImpl; SvpCairoTextRender m_aTextRenderImpl;
......
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