summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-11-02 22:49:54 +0800
committerMark Hung <marklh9@gmail.com>2018-11-05 12:33:27 +0100
commit8abe2d0ff1d87f1db406ab9367a6ee7edb6d234d (patch)
treeaff54d360bad0d50caf809a782490f4a388fe30a /cppcanvas
parent1351d5b97fd3e07c2bac1b7659726809bcb1c28d (diff)
tdf#37636: pass bNormalText to cppcanvas::internal::TextRenderer.
so that we know whether we are rendering a normal text or othewise (like shadow, etc.) because it is not necessary to use the textline color or overline color when rendering the shadow. Change-Id: I51c21bbb4e3cec226320b46e2cdba4cd5e8792d6 Reviewed-on: https://gerrit.libreoffice.org/62831 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 3784d435b086..b43f691e931b 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -476,7 +476,7 @@ namespace cppcanvas
virtual ~TextRenderer() {}
/// Render text with given RenderState
- virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const = 0;
+ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const = 0;
};
/** Render effect text.
@@ -514,7 +514,7 @@ namespace cppcanvas
vcl::unotools::colorToDoubleSequence( rShadowColor,
xColorSpace );
- rRenderer( aShadowState, rTextFillColor );
+ rRenderer( aShadowState, rTextFillColor, false );
}
// draw relief text, if enabled
@@ -532,11 +532,11 @@ namespace cppcanvas
vcl::unotools::colorToDoubleSequence( rReliefColor,
xColorSpace );
- rRenderer( aReliefState, rTextFillColor );
+ rRenderer( aReliefState, rTextFillColor, false );
}
// draw normal text
- rRenderer( rRenderState, rTextFillColor );
+ rRenderer( rRenderState, rTextFillColor, true );
return true;
}
@@ -789,7 +789,7 @@ namespace cppcanvas
private:
/// Interface TextRenderer
- virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
geometry::RealRectangle2D queryTextBounds() const;
css::uno::Reference<css::rendering::XPolyPolygon2D> queryTextBounds(const uno::Reference<rendering::XCanvas>& rCanvas) const;
@@ -895,7 +895,7 @@ namespace cppcanvas
"::cppcanvas::internal::EffectTextAction(): Invalid font or lines" );
}
- bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const
+ bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool /*bNormalText*/ ) const
{
const rendering::ViewState& rViewState( mpCanvas->getViewState() );
const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );
@@ -1246,7 +1246,7 @@ namespace cppcanvas
private:
// TextRenderer interface
- virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
css::uno::Reference<css::rendering::XPolyPolygon2D> queryTextBounds(const uno::Reference<rendering::XCanvas>& rCanvas) const;
@@ -1369,7 +1369,7 @@ namespace cppcanvas
return ::basegfx::unotools::xPolyPolygonFromB2DPolygon(rCanvas->getDevice(), aTextBoundsPoly);
}
- bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const
+ bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool /*bNormalText*/ ) const
{
const rendering::ViewState& rViewState( mpCanvas->getViewState() );
const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );
@@ -1429,7 +1429,7 @@ namespace cppcanvas
}
// TextRenderer interface
- virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override
+ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor,bool /*bNormalText*/ ) const override
{
mrCanvas->fillPolyPolygon( mrLinePolygon,
mrViewState,
@@ -1635,7 +1635,7 @@ namespace cppcanvas
private:
// TextRenderer interface
- virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
// TODO(P2): This is potentially a real mass object
// (every character might be a separate TextAction),
@@ -1765,7 +1765,7 @@ namespace cppcanvas
rTextTransform );
}
- bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/ ) const
+ bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/, bool /*bNormalText*/ ) const
{
const rendering::ViewState& rViewState( mpCanvas->getViewState() );
const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );