Kaydet (Commit) 43e961e4 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Michael Meeks

headless: clip more intelligently without allocating huge masks constantly

üst 40552039
...@@ -41,7 +41,6 @@ class SvpSalGraphics : public SalGraphics ...@@ -41,7 +41,6 @@ class SvpSalGraphics : public SalGraphics
{ {
basebmp::BitmapDeviceSharedPtr m_aDevice; basebmp::BitmapDeviceSharedPtr m_aDevice;
basebmp::BitmapDeviceSharedPtr m_aOrigDevice; basebmp::BitmapDeviceSharedPtr m_aOrigDevice;
basebmp::BitmapDeviceSharedPtr m_aClipMap;
bool m_bUseLineColor; bool m_bUseLineColor;
basebmp::Color m_aLineColor; basebmp::Color m_aLineColor;
...@@ -54,6 +53,22 @@ class SvpSalGraphics : public SalGraphics ...@@ -54,6 +53,22 @@ class SvpSalGraphics : public SalGraphics
ServerFont* m_pServerFont[ MAX_FALLBACK ]; ServerFont* m_pServerFont[ MAX_FALLBACK ];
sal_uInt32 m_eTextFmt; sal_uInt32 m_eTextFmt;
basebmp::BitmapDeviceSharedPtr m_aClipMap;
protected:
Region m_aClipRegion;
basegfx::B2IVector GetSize() { return m_aOrigDevice->getSize(); }
private:
bool m_bClipSetup;
struct ClipUndoHandle {
SvpSalGraphics &m_rGfx;
basebmp::BitmapDeviceSharedPtr m_aDevice;
ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {}
~ClipUndoHandle();
};
ClipUndoHandle ensureClipFor( const basegfx::B2IRange &aRange );
void ensureClip();
protected: protected:
virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
...@@ -76,8 +91,7 @@ public: ...@@ -76,8 +91,7 @@ public:
virtual void SetLineColor(); virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor ); virtual void SetLineColor( SalColor nSalColor );
virtual void SetFillColor(); virtual void SetFillColor();
virtual void SetFillColor( SalColor nSalColor );
virtual void SetFillColor( SalColor nSalColor );
virtual void SetXORMode( bool bSet, bool ); virtual void SetXORMode( bool bSet, bool );
......
This diff is collapsed.
...@@ -533,6 +533,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) ...@@ -533,6 +533,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
// blend text color into target using the glyph's mask // blend text color into target using the glyph's mask
const B2IRange aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() ); const B2IRange aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() );
const B2IRange aClipRect( aDstPoint, aAlphaMask->getSize() );
SvpSalGraphics::ClipUndoHandle aUndo = ensureClipFor( aClipRect );
m_aDevice->drawMaskedColor( m_aTextColor, aAlphaMask, aSrcRect, aDstPoint, m_aClipMap ); m_aDevice->drawMaskedColor( m_aTextColor, aAlphaMask, aSrcRect, aDstPoint, m_aClipMap );
} }
} }
......
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